omsmith / browserify-ngannotate

57 stars 7 forks source link

Sourcemaps support is broken #20

Open lgringo opened 9 years ago

lgringo commented 9 years ago

Since version 0.7, sourcemaps are not relative paths anymore. Was working perfectly before.

Step to reprodruce 1/ Write a small AngularApp using browserify 2/ Create the bundle using "browserify --debug -t browserify-ngannotate myapp.js > bundle.js" 3/ Decode generated sourceMaps : "tail -1 bundle.js | cut -b 65- | base64 --decode NB You need to count the number of characters to exclude (65 in my example)

With browserify-ngannotate 0.6 : Path to source are relative With browserify-ngannotate 0.+7+: Path to source are absolute

When serving the app with http server, absolute sources can't be retrieved. Paths should remain relative.

lgringo commented 9 years ago

You can find a test project here : https://github.com/lgringo/test-browserify-ngannotate

omsmith commented 9 years ago

Think I got this in 1.0.0, let me know

lgringo commented 9 years ago

Great job !

Version 1.0.0 works like a charm.

omsmith commented 9 years ago

Sadly, I'm pretty sure this is now much more broken than before.

Gave omsmith/browserify-1192 a test, and duplicate filenames are overwritten. Seems the solution is to just be able to provide a sourceroot, which may come for free.

I'll be reverting this particular change later in the day.

nathanmarks commented 9 years ago

@omsmith Is this related to browserify coughing things back up with:

Cannot read property 'match' of undefined while parsing file:
pmowrer commented 9 years ago

@nathanmarks We're seeing that same problem, though only for npm linked modules.

pmowrer commented 9 years ago

Turns out this was our own fault. Due to our Browserify configuration mixed with npm linked modules, the browserify-ngannotate transform was applied to the same files twice.

TehShrike commented 8 years ago

So this is actually resolved?