rollup-plugin-npm
Find third party modules in node_modules
, so that they can be included in a Rollup bundle.
Installation
npm install --save-dev rollup-plugin-npm
Usage
import { rollup } from 'rollup';
import npm from 'rollup-plugin-npm';
rollup({
entry: 'main.js',
plugins: [
npm({
jsnext: true,
main: true,
skip: [ 'some-big-dependency' ],
builtins: false,
browser: true
})
]
}).then( bundle => bundle.write({ dest: 'bundle.js', format: 'iife' }) );
import commonjs from 'rollup-plugin-commonjs';
rollup({
entry: 'main.js',
plugins: [
npm({ jsnext: true, main: true }),
commonjs()
]
}).then( bundle => bundle.write({ dest: 'bundle.js', format: 'iife' }) );
License
MIT