Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
rollup-plugin-auto-external
Advanced tools
Rollup plugin to automatically exclude package.json dependencies and peerDependencies from your bundle
Rollup plugin to automatically exclude package.json dependencies and peerDependencies from your bundle.
npm install --save-dev rollup-plugin-auto-external
rollup.config.js
import autoExternal from 'rollup-plugin-auto-external';
export default {
input: 'index.js',
plugins: [autoExternal()],
};
rollup.config.js
with optionsimport path from 'path';
import autoExternal from 'rollup-plugin-auto-external';
export default {
input: 'index.js',
plugins: [
autoExternal({
builtins: false,
dependencies: true,
packagePath: path.resolve('./packages/module/package.json'),
peerDependencies: false,
}),
],
};
rollup.config.js
with externalrollup-plugin-auto-external
does not overwrite the external option. The two can happily coexist.
import autoExternal from 'rollup-plugin-auto-external';
export default {
input: 'index.js',
external: id => id.includes('babel-runtime'),
plugins: [autoExternal()],
};
rollup.config.js
with per format optionsimport autoExternal from 'rollup-plugin-auto-external';
export default ['es', 'umd'].map(format => ({
input: 'index.js',
plugins: [
autoExternal({
dependencies: format === 'es',
}),
],
}));
builtins
boolean
|string
: defaults to true
. Add all Node.js builtin modules (in the running version) as externals. Specify a string
value (e.g., '6.0.0'
) to add all builtin modules for a specific version of Node.js.
Rollup will complain if builtins
is present, and the build target is a browser. You may want rollup-plugin-node-builtins.
dependencies
boolean
: defaults to true
.
packagePath
string
: defaults to process.cwd()
. Path to a package.json file or its directory.
peerDependencies
boolean
: defaults to true
.
FAQs
Rollup plugin to automatically exclude package.json dependencies and peerDependencies from your bundle
We found that rollup-plugin-auto-external demonstrated a not healthy version release cadence and project activity because the last version was released 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.