This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

rollup-plugin-exports-extend

1.1.2 • Public • Published

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

Package Sidebar

Install

npm i rollup-plugin-exports-extend

Weekly Downloads

0

Version

1.1.2

License

MIT

Last publish

Collaborators

  • tehvgg