What will happen if sourcemap is set as false in Angular

后端 未结 3 999
故里飘歌
故里飘歌 2021-02-14 03:33

I\'m new in Angular. I saw sourcemap in tsconfig.json and by default it is \"sourceMap\": true. I had few doubts and found this link usefu

3条回答
  •  我寻月下人不归
    2021-02-14 04:09

    Nothing will change in how the app runs.

    The change will be in your debugging experience.

    Source maps are helpful for debugging code. You write your code in TypeScript, and the compiler turns that source code into JavaScript. When your app is running in a browser like Firefox, the browser is running the JavaScript. Even though the browser is running that JavaScript, if you open the debugger in Firefox, the debugger will display the TypeScript source code and will let you set break points in it. The debugger is able to do that because of source maps, which map the TypeScript source code to the JavaScript runtime code. That is what source maps do: they map the source code to the runtime code to enable source code debugging at runtime.

提交回复
热议问题