nikku / karma-browserify

A fast Browserify integration for Karma that handles large projects with ease
MIT License
321 stars 49 forks source link

Write external sourcemaps #115

Closed ericontilt closed 9 years ago

ericontilt commented 9 years ago

I have a setup where I use karma-browserify with 'tsify' as a plugin and 'reactify' as a transform to build my bundle containing my TypeScript/JS code and my specs. Unfortunately I cannot get WebStorm to play nice with the source map provided within the bundle. I assume the cause of it is due to the insertion of absolute paths within the bundle, or because WebStorm cannot correctly handle the internalized source map.

What I've tried on the command line is invoke browserify and pipe it's output to 'exorcist', which externalizes the source map into a .map file. Using a sample application I've verified that the externalized bundle is then picked up by WebStorm. What would be cool is if I could somehow do this through configuration in karma.conf.js.

I can rebuild the sample application and push it to GitHub if that helps. I've e-mailed with Ben about the issue and I'm happy to implement any suggested solution, but I'm not so sure how to do it. If you need anything else please let me know.

Thanks!

bendrucker commented 9 years ago

Sample application would be helpful. Not sure if using exorcist is going to be viable since it's meant to be used streamingly and karma-browserify handles its file writes synchronously. But since it deals with the source map directly we could add an option for writing it externally. Does WebStorm only pick it up when it's in process.cwd() or can we write it to the tmp dir?

davidreher commented 9 years ago

In our sample application we created it in the tmp dir.

bendrucker commented 9 years ago

Perfect. So it's easy enough to write the map out to a file. Will happily take a PR, otherwise we'll get to it when we have a chance.

ericontilt commented 9 years ago

No worries, I will give it a go!

nikku commented 9 years ago

I am closing this as we will not work on this feature ourselves.

Ping us, if you find time to contribute it.

atdiff commented 7 years ago

@ericontilt @bendrucker did this ever get implemented? Or has anyone figured out how to handle it?

@davidreher how did you have your configuration setup to create them in the tmp dir?