
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
Prebundle Node.js dependencies, output a single js file, a package.json file and the dts files.
Prebundle Node.js dependencies, output a single js file, a package.json file and the dts files.
Based on ncc and rollup-plugin-dts.
Prebundle is used to:
Run following command to prebundle all dependencies:
npx prebundle
Run following command to prebundle single dependencies:
npx prebundle <pkgName>
# For example, prebundle commander
npx prebundle commander
Supported dependency config:
Externals to leave as requires of the build.
// prebundle.config.mjs
export default {
dependencies: [
{
name: 'foo',
externals: {
webpack: '../webpack',
},
},
],
};
You can also configure externals for all packages like this:
// prebundle.config.mjs
export default {
externals: {
webpack: '../webpack',
},
dependencies: [{ name: 'foo' }, { name: 'foo' }],
};
Externals for dts.
// prebundle.config.mjs
export default {
dependencies: [
{
name: 'foo',
dtsExternals: ['webpack'],
},
],
};
Whether to minify the code, default false.
// prebundle.config.mjs
export default {
dependencies: [
{
name: 'foo',
minify: false,
},
],
};
Copy extra fields from original package.json to target package.json.
// prebundle.config.mjs
export default {
dependencies: [
{
name: 'foo',
packageJsonField: ['options'],
},
],
};
Following fields will be copied by default:
nameauthorversionfundinglicensetypestypingtypingsCallback before bundle.
// prebundle.config.mjs
export default {
dependencies: [
{
name: 'foo',
beforeBundle(task) {
console.log('do something');
},
},
],
};
Emit extra entry files to map imports.
// prebundle.config.mjs
export default {
dependencies: [
{
name: 'foo',
emitFiles: [
{
path: 'foo.js',
content: `module.exports = require('./').foo;`,
},
],
},
],
};
Ignore the original .d.ts declaration file, then generate a fake .d.ts file.
This can be used to reduce file size for the packages that do not require type definitions, such as webpack plugin.
// prebundle.config.mjs
export default {
dependencies: [
{
name: 'foo',
ignoreDts: true,
},
],
};
Copy all type definitions files rather than bundle them via rollup-plugin-dts.
// prebundle.config.mjs
export default {
dependencies: [{ name: 'foo', copyDts: true }],
};
Target ECMAScript version, default es2021.
// prebundle.config.mjs
export default {
dependencies: [
{
name: 'foo',
target: 'es2015',
},
],
};
Only bundle the dts files, default false.
// prebundle.config.mjs
export default {
dependencies: [
{
name: 'foo',
dtsOnly: 'true',
},
],
};
Whether to prettier the code and strip comments, default false.
// prebundle.config.mjs
export default {
prettier: true,
};
FAQs
Prebundle Node.js dependencies, output a single js file, a package.json file and the dts files.
We found that prebundle demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.