Performance impact of using css / javascript source-maps in production?

后端 未结 2 1809
忘掉有多难
忘掉有多难 2020-11-29 00:32
  • Should source-maps be used in production environment? Do they provide any benefits other than debugging?
  • Do they impact app load time due to the additional se
2条回答
  •  一向
    一向 (楼主)
    2020-11-29 01:02

    From HTML5 Rocks:

    Basically it's a way to map a combined/minified file back to an unbuilt state. When you build for production, along with minifying and combining your JavaScript files, you generate a source map which holds information about your original files. When you query a certain line and column number in your generated JavaScript you can do a lookup in the source map which returns the original location. Developer tools (currently WebKit nightly builds, Google Chrome, or Firefox 23+) can parse the source map automatically and make it appear as though you're running unminified and uncombined files.

    http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/

提交回复
热议问题