Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I specify a file source map after the page loads up?

I'm a big fan of source maps for javascript and SASS; however, I don't want to load source maps into production for a couple of reasons: the original source code is available and it's not a good use of bandwidth.

But, sometimes, the need for debugging in production arises (we've all seen production-only bugs on the front-end).

Is there a way for me to specify a source map after the fact? For example, I could have a source map available locally or behind a VPN-locked server, or even in a folder that's not visible to the user. I'm fine with doing it at run time or specifying a setting and having to reload the page. (actually if I could persist that setting that'd be even better).

like image 251
antjanus Avatar asked Mar 24 '16 15:03

antjanus


1 Answers

You can right-click on a minified source file and select "Add Source Map". Then paste in the URL of the map file.

If your mappings file doesn't include the original file contents alongside the mappings make sure the original file paths are accessible to Chrome.

Add Source Map

like image 165
Matt Zeunert Avatar answered Oct 20 '22 21:10

Matt Zeunert