0.1.0 • Published 3 years ago

@azimutlabs/rollup-plugin-external v0.1.0

Weekly downloads
88
License
MIT
Repository
github
Last release
3 years ago

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

NameDescriptionTypeDefault
useDependenciesIndicates whether to include dependencies from package.jsonbooleantrue
usePeerDependenciesIndicates whether to include peer dependencies from package.jsonbooleantrue
useBuiltinsIndicates whether to include Node.js builtin modulesbooleantrue
checkForBabelMacroIndicates whether to check package.json for Babel Macro packagesbooleanfalse
packagePathDirectory or path to package.json. If not provided, looks for the closest package.json starting from current directorystringprocess.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