Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source map: source paths are not always relative #46

Closed
kottenator opened this issue Feb 10, 2016 · 5 comments · Fixed by #50
Closed

Source map: source paths are not always relative #46

kottenator opened this issue Feb 10, 2016 · 5 comments · Fixed by #50

Comments

@kottenator
Copy link

I use uglifyify with babelify. I do:

browserify src.js -o out.js -t [ babelify --presets=babel-preset-es2015 ] -t uglifyify -d

In the result source map, there is:

{
  "version": 3,
  "sources": [
    "../../../usr/lib/node_modules/browserify/node_modules/browser-pack/_prelude.js", 
    "/home/usr/prj/src.js", 
    "/home/usr/prj/utils.js"
  ],
  "names": [], 
  "mappings": "...", 
  "file": "generated.js", 
  "sourceRoot": "", 
  "sourcesContent": [ "...", "...", "..."]
}

As you can see, Browserify file path is relative but my project paths are absolute.

I don't want to disclose my file system paths. Could you fix this?

@yoshuawuyts
Copy link
Collaborator

ah, that's annoying. The easy solution would be to not include source maps for production (standard practice); if this - however - isn't an option for you... PR welcome!

@kottenator
Copy link
Author

I'm not sure if I'm qualified enough to do a PR.

Btw, when I do browserify src.js -o out.js -t babelify -d without uglifyify - it defines relative paths in the source map correctly.

@yoshuawuyts
Copy link
Collaborator

@kottenator ah well sure you are, ✨ believe in yourself ✨

@rmadamanchi
Copy link

Any ETA for a release with this fix?

@yoshuawuyts
Copy link
Collaborator

Released as v3.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants