Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
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
The npm package rollup-plugin-auto-external receives a total of 22,068 weekly downloads. As such, rollup-plugin-auto-external popularity was classified as popular.
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
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.