gobblejs / gobble-browserify

Bundle CommonJS modules with gobble and Browserify
4 stars 9 forks source link

extract sourcemap and fix it #5

Closed Rich-Harris closed 9 years ago

Rich-Harris commented 9 years ago

As far as I can tell, browserify makes the assumption that the output file will be written to the same basedir as input modules are relative to. This means that if the destination file has the same name as one of the entries, all hell breaks loose when gobble later flattens the sourcemap chains, because it gets stuck in an infinite loop.

I'm not 100% clear on the solution, and it should probably wait until some other sourcemap kinks are worked out of gobble, but this PR does two things - it extracts the sourcemap into a separate file (inline sourcemaps are a bit silly, IMHO), and makes all the sources paths absolute.