What is the function of the .js.map files in AngularJs , and is there a problem if the file is not included?
What is the function of the .js.map files in AngularJs , and is there a problem if the file is not included?
More information here .
The map files (source maps) are responsible for decompiling the Javascript code so you can debug it in the browser.
In many projects the developers use languages such as Typescript, Javascript ES2016, CoffeScript, Dart ... to be able to forget the compatibility problems between browsers.
Then this code is transformed (it "transpiles") into standard Javascript using a tool that allows, by means of previous configuration, to choose the compatibility of the code with all types of browsers. For example, IE10 does not support the creation of variables with let
, so the transpiler is responsible for replacing all let
with var
and making sure that the behavior is the same ( it is not as trivial as it seems). In the same way you can add features (such as promises) that are not available in older browsers.
Finally, the code is usually "minified", making it illegible.
Therefore, the code that reaches the browser is something like this .
But these transpilers can create a file that allows the browser to display the original source code when we debug our application even if they are running the compiled version: