Suppose that there is a js file with source-map in subdirectory of a html file.
then which is the sourceMappingURL comment of myjs.js ?
//# sourceMappingURL=myjs.js.map
or
//# sourceMappingURL=js/myjs.js.map
The SourceMap HTTP response header links generated code to a source map, enabling the browser to reconstruct the original source and present the reconstructed original in the debugger. Header type.
Definition. A Sourcemap is a file that maps from the transformed source to the original source. It is a mapping between the generated/transpiled/minified JavaScript file and one or more original source files. The main purpose of Sourcemaps is to aid debugging.
The . map files are for JavaScript and CSS (and now TypeScript too) files that have been minified. They are called source maps. When you minify a file, like the angular. js file, it takes thousands of lines of pretty code and turns it into only a few lines of ugly code.
I lookup to the specification.
When the source mapping URL is not absolute, then it is relative to the generated code’s “source origin”. The source origin is determined by one of the following cases:
So if you use <script src="js/myjs.js">
in index.html the js/myjs.js.map
is used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With