rollup-plugin-node-resolve-magic

0.2.11 • Public • Published

rollup-plugin-node-resolve-magic NPM version Build Status Coverage Status Dependency Status Gitter chat

Locate modules using the Node resolution algorithm, for using third party modules in node_modules. Differs in the following ways from rollup-plugin-node-resolve:

  • Automatically degrades from 'module' -> 'jsnext:main' -> 'main' -> 'index.js'
  • Correctly resolves symlinked packages.
  • Prefers entry-module basedir as basedir for resolution (ideal for bundled apps, prevents duplication of shared modules).

Originally developed as part of Handroll.

Install

$ npm install rollup-plugin-node-resolve-magic --save-dev

Usage

Add the following code to your project's rollup.config.js:

import nodeResolve from 'rollup-plugin-node-resolve-magic';

export default {
  entry: 'index.js',
  plugins: [
    nodeResolve({
      // defaults
      basedir:        path.dirname('index.js'),
      browser:        false,
      extensions:     ['.js', '.json', '.coffee', '.pug', '.styl'],
      preferBuiltins: true,
      skip:           []
    })
  ]
};

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.11
    2
    • latest

Version History

Package Sidebar

Install

npm i rollup-plugin-node-resolve-magic

Weekly Downloads

2

Version

0.2.11

License

MIT

Unpacked Size

37.7 kB

Total Files

9

Last publish

Collaborators

  • zeekay