Search source browser maps

Source maps are very useful for debugging minimal scripts or translated languages ​​(like CoffeeScript), but the browser gives you very little information to troubleshoot why your mapping does not work. Does anyone have a checklist that you can use to find where your mapping goes wrong. Now I have a setting that works in my local development environment, but when I try to deploy it to our intermediate server, "this will not work."

Things I checked match between my local and intermediate environment:

  • Source maps are included in inspector settings
  • The package.min.js file is served from / js
  • The .min.js package contains the line //@ sourceMappingURL=package.min.js.map
  • Minified source + source map created by uglify-js2
  • Source files available in / js

One of the differences that I see is that the size of the generated source map is slightly different, and the file in the source attribute of the sourcemap hash has a slightly different order. But the original map is quite large, so it’s not trivial to verify that it does not differ significantly in a significant way.

+6
source share
1 answer

Source maps (and source source files) are retrieved via HTTP. Look at your server’s logs to see what the browser is really requesting.

Also: //@ will be replaced with //# .

+1
source

Source: https://habr.com/ru/post/946558/


All Articles