Reputation: 3015
I have searched the web to look for an easy to understand definition of the JQuery map and what it does but was unable to find one that I could easily comprehend.
When I use Chrome DevTools I see that the JQuery.min.map is loaded but it is return with the status error NOT FOUND
.
//@ sourceMappingURL=jquery-1.10.2.min.map
I see this line in a JQuery version I looked at. So my question is, what is the point of the map? Why is the JQuery map not in the page source code and rather as that line above in the JQuery source and only loaded in DevTools? What is it useful for and what does it do?
Upvotes: 1
Views: 283
Reputation: 816404
So my question is, what is the point of the map?
To map symbols in the minified or transpiled (or both) source code to their correct position in the original source code. This makes debugging transformed code much(!) easier.
Why is the JQuery map not in the page source code and rather as that line above in the JQuery source and only loaded in DevTools?
Because it's not part of the actual source code and only used for debugging.
What is it useful for and what does it do?
See the first answer.
More information about source maps: Introduction to JavaScript Source Maps
Upvotes: 2