What is the difference between setting sourceMap in tsconfig and in angular.json

Viewed 49

I want to enable source maps for the production build target in an angular workspace for debugging purposes.

I have set in the tsconfig.json

"sourceMap": true

This did not give the source maps in Chrome's Dev Tools.

Setting it in the angular.json as below works

{
      "build": {
        ...
        "configurations": {
          "prod": {
            "sourceMap": true
            ...
          }
          ...
        }
      }
    }

Why did it not work when enabling the source maps via the tsconfig?

Is it because Angular has its own special compiler/transpiler that handles Angular specific code like decorators, template code etc.?

Update

I have disabled sourceMap in the tsconfig.json and enabled it only in angular.json. I do get the source maps when I build the app.

What am I misunderstanding?

0 Answers
Related