1.0.6 • Published 7 years ago

rollup-plugin-force-binding v1.0.6

Weekly downloads
214
License
MIT
Repository
github
Last release
7 years ago

rollup-plugin-force-binding

Force all import bindings for a module to come from one absolute source. Useful for bundles with multiple entry points that have shared dependencies at different absolute paths.

// entry A
import SomeDependency from 'some-dependency';
// resolved path: ~\path\to\A\node_modules\some-dependency\...

// entry B
import SomeDependency from 'some-dependency';
// resolved path: ~\path\to\B\node_modules\some-dependency\...

// resulting in bundled duplicates
var SomeDependency = (function () {})();
var EntryA = (function (_SomeDependency) {})(SomeDependency);

var SomeDependency$2 = (function () {})();
var EntryB = (function (_SomeDependency) {})(SomeDependency$2);

Install

$ npm i rollup-plugin-force-binding [--save-dev]

Usage

If used in junction with node-resolve, place force-binding BEFORE in the plugin array.

import forceBinding from 'rollup-plugin-force-binding';

rollup.rollup({
  plugins: [
    forceBinding([
      // regular module
      'some-dependency',
      // pathed module (some-dependency/src/Asset.js)
      'Asset' // 'Asset.js' also valid
    ])
  ]
});

License

MIT

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago