Using Sourcemap to quickly locate problems in JavaScript

Source: Internet
Author: User
Tags min

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/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.