Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Load remote source maps in chrome dev-tools

Is it possible to load a remote source maps file in chrome dev-tools?

My js file includes //# sourceMappingURL=file.js.map . but this file is actually located in a different location (for security reasons..).

Can I tell chrome dev-tools the source maps file location manually?

like image 363
Yoni Dabush Avatar asked Jun 08 '16 07:06

Yoni Dabush


People also ask

How do I enable a source map in CSS?

Go to chrome://flags/#enable-devtools-experiments and enable the Developer Tools experiments, boot Chrome. Goto devtools, open the settings, and tick the "Enable CSS source maps" and "Auto-reload generated CSS". Inspect an element and, BOOM! There it is.


1 Answers

So the answer for this is rather simple.

  1. Go to the sources tab in chrome dev tools and find your script
  2. Click on the file to open it
  3. Do not use pretty print! the context menu on the file content changes if you pretty print it.
  4. Right click on the file content and select "Add source maps..."
  5. Enter the source maps file location (full URL with protocol)
like image 71
Yoni Dabush Avatar answered Nov 14 '22 21:11

Yoni Dabush