1.1.2 • Published 6 years ago

rollup-plugin-exports-extend v1.1.2

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

rollup-plugin-exports-extend

Remap the exports object in an IIFE bundle to extend and existing object.

// ES5 IIFE bundle w/ Rollup
var myLib = (function (exports)) {
  var MyClass = function () ...
  exports.MyClass = MyClass;
}({})); // <--- object we want to remap

// Now after setting an object to extend
var myLib = (function (exports)) {
  var MyClass = function () ...
  exports.MyClass = MyClass;
}(someOtherWindowObject));

// Accounts for any globals after the export
}(someOtherWindowObject, window.jQuery));

Install

$ npm i rollup-plugin-exports-extend [--save-dev]

Usage

import rollup from 'rollup';
import exportsExtend from 'rollup-plugin-exports-extend';

rollup.rollup({
  plugins: [
    exportsExtend('someOtherWindowObject')
    // can also do something like 'this.lib.obj' if it will already exist when your lib is loaded
  ]
});

License

MIT

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.8

7 years ago

1.0.7

7 years ago

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