Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

rollup-plugin-node-resolve-magic

zeekay129MIT0.2.11

Rollup.js plugin which resolves third-party dependencies in node_modules

commonjs, node_modules, npm, rollup-plugin

readme

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