Link to home
Start Free TrialLog in
Avatar of Abhilash Nagar
Abhilash Nagar

asked on

Javascript - Source map file (or file with .map extension) how to work on it.

Hello,

There are 2 existing files i am working on. One is :

Test.js
Test.js.map

So if i need to update Test.js how to do it (As everything is referenced from a source map file).
So browser picks up source map file as the primary source. (Test.js.map)

How to update the source map file or is there any other option if i can detach this file permanently and so that code can be referenced just from Test.js file.

Never used .map file before.

Thanks.
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

.map files are usually generated as part of a minifying process (example WebPack) you don't edit them directly.
Avatar of Abhilash Nagar
Abhilash Nagar

ASKER

Thanks for the response and time,so is there any process or some information I can follow or some steps to work on it. Never used before.
If you have a look at a Map file it is not something that you can easily follow.
These are generated files.
As Julian says, the js and map files are automatically generated so you don't edit them directly. Normally, these files are the result of a development process that is carried out on the original source files (concatenation / uglify etc). For example, you may have started out with 10 seperate Javascript files - the original source files. The development process is then ran on those source files using something like webpack or gulp and the result is a single js file with a single map file. These files are then used in production. If you want to edit your JS, then you generally edit your original JS files and re-run the development process.

If you don't have the original JS files, then you're going to have problems editing the file.
ASKER CERTIFIED SOLUTION
Avatar of Abhilash Nagar
Abhilash Nagar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial