
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@enonic/esbuild-plugin-copy-with-hash
Advanced tools
An esbuild plugin to copy files adding hash and making manifest.json
npm install --save-dev @enonic/esbuild-plugin-copy-with-hash
import esbuild from 'esbuild'
import copyWithHashPlugin from 'esbuild-plugin-copy-with-hash';
await esbuild.build({
// ...
plugins: [
copyWithHashPlugin({
context: 'node_modules',
patterns: [
'react/{cjs,umd}/*.js',
'react-dom/{cjs,umd}/*.js',
]
})
],
// ...
})
import copyWithHashPlugin from 'esbuild-plugin-copy-with-hash';
export default defineConfig((options) => {
return {
// ...
esbuildPlugins: [
copyWithHashPlugin({
context: 'node_modules',
patterns: [
'react/{cjs,umd}/*.js',
'react-dom/{cjs,umd}/*.js',
]
})
],
// ...
}
}
options?.addHashesToFileNamesType: Boolean
Default: true
Whether or not to add the content hashes to the filenames. This option does NOT affect the content of the manifest file.
options?.contextType: String
Default: ''
options?.context is relative to cwd().
options?.hashType: function
Default: (fileBuffer: Buffer) => bigint2base(xxh3.xxh64(fileBuffer), '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ')
The default hashing algorithm is xxh3.xxh64 with uppercase base36. This will typically yield a contenthash that is 12 to 13 characters long. You can provide your own hashing algorithm, keep in mind some filesystems are case "insensitive".
options?.manifestType: String
Default: 'manifest.json'
The path (relative to esbuildOptions.outdir joined with options?.to) to the generated manifest file.
options.patternsType: (string | { context?: string from: string to?: string })[]
A list of patterns (globs) to copy.
The glob is relative to cwd() joined with options?.context and pattern?.context.
The pattern?.to is relative to esbuildOptions.outdir joined with options?.to.
import esbuild from 'esbuild'
import copyWithHashPlugin from 'esbuild-plugin-copy-with-hash';
await esbuild.build({
// ...
plugins: [
copyWithHashPlugin({
context: 'node_modules',
patterns: [
'react/{cjs,umd}/*.js',
{
context: 'react-dom',
from: '/{cjs,umd}/*.js',
to: 'react-dom/'
}
],
to: 'subdir'
})
],
// ...
})
options?.toType: String
Default: ''
options?.to is relative to esbuildOptions.outdir.
MIT
FAQs
An esbuild plugin to copy files adding hash and making manifest.json
We found that @enonic/esbuild-plugin-copy-with-hash demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.