Skip to content

Instantly share code, notes, and snippets.

@halfnibble
Created July 28, 2016 07:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halfnibble/13b279b9214ee2c4382f29cd4d6ca7dd to your computer and use it in GitHub Desktop.
Save halfnibble/13b279b9214ee2c4382f29cd4d6ca7dd to your computer and use it in GitHub Desktop.
In case you want to include a function or variable eliminated by Rollup.js treeshaking.
export var loadModule = function(module) {
// Trick Rollup.js to keep JavaScript.
let obj = {
method: function() {}
};
obj.method(module);
};
/* Example usage
* =============
import { loadModule } from './loadModule';
import { my_dom_function } from './utils';
loadModule(my_dom_function);
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment