stevenbenisek/rollup-plugin-auto-external(新しいタブで開きます)
主要言語: JavaScript
Rollup plugin to automatically exclude package.json dependencies and peerDependencies from your bundle
- star 数
- 69
- watcher 数
- 3
- fork 数
- 9
- issue 数
- 10
- 最終更新
- 2020/05/05
主要言語: JavaScript
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
import autoExternal from 'rollup-plugin-auto-external'; export default { input: 'index.js', plugins: [autoExternal()], };
import 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()], };
import autoExternal from 'rollup-plugin-auto-external'; export default ['es', 'umd'].map(format => ({ input: 'index.js', plugins: [ autoExternal({ dependencies: format === 'es', }), ], }));
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.
boolean: defaults to true.
string: defaults to process.cwd(). Path to a package.json file or its directory.
boolean: defaults to true.