Skip to content

ashleyw/rollup-plugin-internal

Repository files navigation

rollup-plugin-internal

npm version

Rollup plugin to explicitly mark dependencies as internal in order to include them in the emitted bundle.

Works best in tandem with other dependency-management plugins such as rollup-plugin-auto-external, which will mark all NPM dependencies as external and exclude them from the bundle. Then by using rollup-plugin-internal, you're able to specify just the dependencies you want to be included.

Install

yarn add -D rollup-plugin-internal

Usage

Example rollup.config.js
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import autoExternal from 'rollup-plugin-auto-external';
import internal from 'rollup-plugin-internal';

export default {
  input: 'index.js',
  output: {
    file: 'my-date-picker-widget.js',
    format: 'cjs'
  },
  plugins: [
    resolve(),
    commonjs(),
    autoExternal(),

    // should be the last plugin
    internal(['moment', 'react-dates']),
  ],
};

Options

  • modules: string[] — Array of dependencies to mark as internal.

About

Rollup plugin to explicitly include dependencies in the emitted bundle

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published