Chrome: Add local JavaScript SourceMap possible?

agrafix picture agrafix · Feb 11, 2014 · Viewed 8.6k times · Source

Is it possible to add a local SourceMap? I have a Website, which I cannot modify, containing compressed (closure) JavaScript. I have a local JavaScript-SourceMap belonging to that file. Is there any way to tell GoogleChrome (or any other browser) to add a SourceMap before/after the page loads?

Answer

JeFf picture JeFf · Jul 22, 2015

You cannot point to file containing the map. You can however host your map locally and then point to localhost address. In the javascript source file there also must not be

//# sourceMappingURL=...

comment presented since than Chrome DevTools won't load the sourcemap if it is different than specified in the URL.