A babel plugin adding the ability to rewire modul dependency. This enables to mock modules for testing purposes.
@speedskater on thing I am noticing is that Rewire isn't available on a * import:
import * as mymodule from './mymodule;
mymodule.Rewire is undefined. if I have a export default fallback it seems to work. Is that your suggested use?
@speedskater came across an edge case. I am getting:
Duplicate declaration "typeOfOriginalExport" (This is an error on an internal node. Probably an internal error)
and I think its because it is doing the rewire twice. I am using gulp babel and also a build procedure with a dynamic require. Is there a check to see if the import/require has already been rewired?