Everyone has had the experience of using-min.js development, but such scripting debugging is a pain in the neck. If used as a compressed version of the line before going to compression, sourcemap the emergence of a perfect solution to this problem.
Even if Chrome provides formatting code, reading the compressed code looks very laborious.
Take Angularjs as an example, talk about the use of Sourcemap.
My folder structure is as follows:
Because Google is often the wall, it is recommended to download Angular.js angular.min.js angular.min.js.map to Local.
and modify the configuration of the Sourcemap in Angular.min.js to point to the local map file.
# Sourcemappingurl=angular.min.js.map
The HTML code is as follows:
If there is an error in the development process, you can easily locate the source location and find out the cause of the problem.
Surcemap not used
Using Sourcemap
At present, many class libraries provide sourcemap support.
Author: cnblogs Small Jade Watermelon
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/script/