mikey balls
mikey balls

Reputation: 115

What does this line do at the bottom of underscore.js?

I use a similar line to alert the browser that there is a file for debugging purposes.

//# sourceURL=lib_underscore.js

But what is this line

//# sourceMappingURL=underscore-min.map

Upvotes: 0

Views: 42

Answers (1)

Drew Dahlman
Drew Dahlman

Reputation: 4972

That is a source map. This is used for debugging compressed scripts. https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Use_a_source_map

JavaScript sources are often combined and minified to make delivering them from the server more efficient. Increasingly, too, JavaScript running in a page is machine-generated, as when compiled from a language like CoffeeScript or TypeScript. By using source maps, the debugger can map the code being executed to the original source files, making debugging much, much easier.

Upvotes: 2

Related Questions