@azimutlabs/rollup-plugin-external
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

🍣 azimutlabs logo /rollup-plugin-external

Rollup plugin to exclude external dependencies from bundle

azimutlabs/rollup repository github workflow status azimutlabs/rollup repository license @azimutlabs/rollup-plugin-external

Installation

$ yarn add -D @azimutlabs/rollup-plugin-external

Usage

// rollup.config.js
import external from '@azimutlabs/rollup-plugin-external';

export default {
  input: 'index.js',
  plugins: [
    external({
      // Default options.
      useDependencies: true,
      usePeerDependencies: true,
      useBuiltins: true,
      checkForBabelMacro: false,
      packagePath: process.cwd(),
    }),
  ],
};

Plugin does not override rollup's external option. Instead, it firstly looks for external, then applies plugin's core functionality

// rollup.package.js
import external from '@azimutlabs/rollup-plugin-external';

export default {
  input: 'index.js',
  plugins: [external()],
  external: id => id.includes('fp-ts'),
};

Options

Name Description Type Default
useDependencies Indicates whether to include dependencies from package.json boolean true
usePeerDependencies Indicates whether to include peer dependencies from package.json boolean true
useBuiltins Indicates whether to include Node.js builtin modules boolean true
checkForBabelMacro Indicates whether to check package.json for Babel Macro packages boolean false
packagePath Directory or path to package.json. If not provided, looks for the closest package.json starting from current directory string process.cwd()

Acknowledgement

This plugin was inspired by rollup-plugin-auto-external

Contributing

Any PR is welcomed by our @js-opensource team. Check out our contributing guidelines for more info.

License

azimutlabs rollup config license

Package Sidebar

Install

npm i @azimutlabs/rollup-plugin-external

Weekly Downloads

3

Version

0.1.0

License

MIT

Unpacked Size

11.9 kB

Total Files

10

Last publish

Collaborators

  • azimutlabs-owner
  • olehan