This article is a mirror article of machine translation, please click here to jump to the original article.

View: 9644|Reply: 0

[JavaScript] js.map file meaning (turn)

[Copy link]
Posted on 7/3/2018 9:26:46 AM | | |
What is a source map file?
The source map file is a metadata file that replaces the corresponding variable name and the location of the variable after the JS file is compressed, and generally this file is placed in the same directory as the min.js master file. For example, the original variable after compression is map, and after compression, it may be replaced with a by the variable replacement rule, at this time, the source map file will record the information of this mapping, which is the advantage that when debugging, if there are some JS errors, then the browser will remerge the compressed js by parsing the map file, so that developers can use the code before compression to debug, which will bring us great convenience!
And this kind of reductive debugging function, currently only chorme has, so there will be a problem with the title, when I introduced the jquery-1.10.2.min.js, it is good under Firefox or other browsers, and it will be reported that it cannot find the jquery-1.10.2.min.map file under chorme, 404, because of the above situation, jquery will detect whether the browser supports the source map function If it is supported, then download the source map file, and at this time if you are referring to the official website min.js then no problem, it will go to its own directory to find the source map file, and if the jquery.min.js file is on your server and there is no source map on the server, then it will be reported incorrectly!

Three solutions:

1. Quote the official website documents
2. Download the source map file and put it on the server (recommended)
3. Check the chorme file tool > developer tools -> settings -> Enable source maps, remove this check, jquery will not download the source map file!




Previous:Getting started guide: Typescrip{filter}t
Next:Use the tsconfig configuration file
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com