Created
July 28, 2016 07:35
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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