Hacker News new | ask | show | jobs
by bromuro 3836 days ago
> I'm clearly in the minority, but I had qualms about uglify and other source manglers [...]: they break the benefits of view source

Not really: we have source maps for this.

2 comments

“View source” is a tool for outside end-users who want to understand or reverse-engineer code on websites they don’t control. “Source maps” is a tool for inside developers trying to debug their own code. Whether or not the browser supports source maps is irrelevant if you don’t have access to the original code, but only the minified/mangled version with all single-character variable names.
>Whether or not the browser supports source maps is irrelevant if you don’t have access to the original code

Sourcemaps can embed the original source inline, though of course that is a decision made by the author and they can decide not to make sourcemaps that way. It is more likely that the end-user doesn't have access to the source maps anyway.

I would love to see examples of source maps working in the wild.