-
Notifications
You must be signed in to change notification settings - Fork 128
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
rewire doesn't work with babel #55
Comments
Having the same issue as well. |
Yes, probably the same error as in jhnns/rewire-webpack#12 |
Is React using Babel for transpiling? |
+1 Using Babel for transpiling. |
I can't see how this could be fixed by my side. As @sairion pointed out, babel is changing variable names. Thus all uses of I hope babel will do something about it. Although |
This is super disappointing as Rewire is the most useful library ever! It might be worthwhile to start a discussion with the Babel folks. I'll go ahead and close. |
Hm, then we may have a problem. Babel says it's not their issue: babel/babel#1337 |
For what it's worth, @speedskater has written an alternative that works with Babel's ES6 module compilation. https://github.com/speedskater/babel-plugin-rewire |
Note that |
I've just finished porting all of my React.js code to ES6 and found that my tests have broken due to Rewire (seemingly) not supporting the new syntax.
However, when importing using
var states = require('utils/states')
everything is just fine.Any assistance would be appreciated!
The text was updated successfully, but these errors were encountered: