adding intersection of require calls
These changes should allow intersection of require calls in the module. The require function gets substituted with one that delegates calls to either a custom function, or one that uses an object as a path ->module map.
I have included some test code, and a line in the readme talking about the feature.
Thank you for your detailed PR (with tests and docs :+1:). I'm definitely willing to merge this as it was already requested several times ( #24 #44 #68 ).
One problem I see, though, is that it needs to be implemented for rewire-webpack as well. I would like users to be able to use rewire features also with webpack without needing to care about which feature is supported.
I need some time to implement it ...