Created
August 20, 2017 06:49
-
-
Save rich-97/87ee0e40b94821355509c9bff33bc255 to your computer and use it in GitHub Desktop.
Liltle snippets for webpack export single object.
This file contains hidden or 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
module.exports = {} | |
// Resolve the problem with the context (is by webpack). | |
Object.keys(module.exports).forEach(function (key) { | |
if (typeof module.exports[key] === 'function') { | |
module.exports[key] = module.exports[key].bind(module.exports) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The context between methods isn't work properly, this bug is in webpack
2.3.3
.