0.2.1 ā€¢ Published 2 years ago

rollup-plugin-node v0.2.1

Weekly downloads
58
License
MIT
Repository
github
Last release
2 years ago

npm

rolup-plugin-node

šŸ£ A Rollup plugin which improve rollup usage with nodejs projects

This plugin declares all nodejs native deps in external and try to remove require/import for all unknown others. It's solve (most of the time) optional import from an external library that rollup actually don't manage very well ;).

Requirements

This plugin requires an LTS Node version (v12.0.0+) and Rollup v1.20.0+.

Install

Using npm:

npm install rollup-plugin-node --save-dev

Usage

Create a rollup.config.js configuration file and import the plugin:

import rollupPluginNode from 'rollup-plugin-node';

export default {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs'
  },
  plugins: [rollupPluginNode()]
};

That's all!!

Tips: put it after commonjs node

Additional options

{
    additionalOptionalDeps: {
        'somethingVeryUsefull.node': './addon',
        'partial/path/somethingVeryUsefullWithPartialPath.node': './addon',
    }
}
  • additionalOptionaDeps : : A map of filename and destination (relative to the output)
0.2.1

2 years ago

0.2.0

2 years ago

0.1.6

2 years ago

0.1.2

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.5

2 years ago

0.1.0

3 years ago

0.1.1

3 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago