How to use source map files on different OS

I use the source map for js files on both the production server and the dev server, so I just load it from local storage. In this case, I use the following line at the end of the files // # sourceMappingURL = file: //// var / www / static /. which points to my local store. But I want to use it for both the Linux operating system and for Windows. Therefore, for Windows this line is not valid: //// var / www / static /, I have to use the file: //// C: / www / static /. In this case, the Linux browser may receive this file. Is it possible to use some kind of universal link that will work like in OS

+6
source share
1 answer

Sourcemap tells the client how to download the file. The client should not have a clue about your file system.

The mapping should be valid: # sourceMappingURL=/path/to/file.js.mapwhere it /path/to/file.js.mapwill be allowed:http://www.example.com/path/to/file.js.map

The client is fully agnostic for file systems.

In addition, you do not have to be protocol service resources file://.

+2
source

Source: https://habr.com/ru/post/1016661/


All Articles