i-like-robots / rewireify

Rewireify is a port of Rewire for Browserify that adds setter and getter methods to each module so that their behaviour can be modified for better unit testing.
https://www.npmjs.com/package/rewireify
Other
59 stars 10 forks source link

Does not seem to work with source mapping #12

Open scottburch opened 9 years ago

scottburch commented 9 years ago

Thanks for porting this to browserify.

browserify -t [reactify --es6 --target es5] -t rewireify spec/$FILE -o build/$FILE --debug

Adding the --debug flag with rewireify throws parsing errors. I would love to have source maps also.

i-like-robots commented 9 years ago

Thanks for reporting... I confess I've never attempted to use this with the --debug flag so I'll check it out.

scottburch commented 9 years ago

Weird, I swapped reactify and wireify and it seems to work.

browserify -t rewireify -t [reactify ...] ...

i-like-robots commented 9 years ago

Just to confirm I can recreate this and fix it as you describe in my Tube Tracker app when building the test bundle (though the --debug flag works as expected when compiling the dev bundle). I'll investigate further.

srosato commented 8 years ago

Any news on this? I am trying this with tsify and debowerify with typescript and I am getting a parser error too on the source maps.

browserify -v -d -p [tsify --jsx=react] -t rewireify -t debowerify

I also tried:

browserify -v -d -t rewireify -p [tsify --jsx=react] -t debowerify
scottburch commented 8 years ago

I know this probably does not help, but I thought I would mention it since I was in the discussion. I switched from using browserify to webpack. After the learning curve, I find it to be much more powerful and easier.

srosato commented 8 years ago

Yeah well I will probably look into it too. For now I can confirm I am able to make it work with reactify and rewireify by swapping the arguments like you previously said, but I get the parse error when using tsify for typescript and I've been digging most of the afternoon for now...