babel-plugin-rewire icon indicating copy to clipboard operation
babel-plugin-rewire copied to clipboard

Rewire adds a default export to modules that don't have them

Open niran opened this issue 8 years ago • 2 comments

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.

niran avatar Jun 14 '16 20:06 niran

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.

niran avatar Jun 14 '16 20:06 niran

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.

speedskater avatar Jun 27 '16 14:06 speedskater