babel-plugin-rewire
babel-plugin-rewire copied to clipboard
Rewire adds a default export to modules that don't have them
I have code that treats an imported module as an object to pass as arguments, but rewire is adding a default import with a non-enumerable __Rewire__
property. This extra default key breaks my code.
This seems to be by design, and I've modified my code to work around it, but it'd be nice if there were a way to turn it off so I could use rewire without modifying my codebase.
Thanks for pointing this out. The problem is already known and mentioned in other issues (eg. Issue #78). I think a solution which allows to configure the way to receive the RewireAPI might be the way to go, but it will some more time till we can actually handle this. If you are interested to tackle this issue this would be really great. In this case we could schedule a skype call to discuss this issue and its sideffect in more detail.