-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not working with Webpack 2 beta #22
Comments
With webpack 2.2.0, the error is now:
|
I took a stab at fixing this issue of webpack 2 compatibility. If you apply my changes at gkovacs@31da0a9 it resolves both the issues above, however the |
A hackish workaround for now until rewire-webpack is fixed to work with webpack 2 is to just insert the export __get__ = (name) ->
return eval(name)
export __set__ = (name, val) ->
eval(name + ' = val') I believe in javascript it would be module.exports.__get__ = function(name) {
return eval(name);
}
module.exports.__set__ = function(name, val) {
eval(name + ' = val');
} And clear the module cache before each require, via delete require.cache[require.resolve('libs_frontend/dom_utils')] To see a full example see https://github.com/habitlab/habitlab/blob/539443c123d335099cafdde2df35b40264a0acad/test/libs_frontend/dom_utils.test.ls and https://github.com/habitlab/habitlab/blob/539443c123d335099cafdde2df35b40264a0acad/src/libs_frontend/dom_utils.ls |
For webpack 4 support, you can use my fork rensbaardman/rewire-webpack-plugin. |
My tests that were working with Webpack 1 and rewire now fail under webpack 2 beta.
I receive the error:
The text was updated successfully, but these errors were encountered: