0

After updating to the latest version of angular I notice console logs no longer display the source file names and line numbers of the output.

Instead of something like

Hello World login.component.ts: 34: 5

I will now only see something like

"Hello World main.js:1"

At first, I thought it was building the project in prod mode so the files were being bundled together (since they are outputting in js now), but I'm pretty sure I'm compiling in dev mode and not actually building anything (isDevmode is true).

console output example

I am running my project with npm start or ng serve (with assigned port). I haven't seen much on other web resources regarding this, so can anyone share their insight if they have some? Thanks.

cloned
  • 6,346
  • 4
  • 26
  • 38
will
  • 11
  • 2
  • Welcome to SO community, will! in the tsconfig do you have `sourceMap` set to `true`? – IAfanasov Jul 13 '21 at 14:39
  • This is a known-issue with ng12. Fix here: https://stackoverflow.com/questions/67598130/angular-12-ng-serve-builds-apps-slowly-almost-like-production-builds – MikeOne Jul 13 '21 at 14:40

1 Answers1

0

Thanks @MikeOne,it looks like adding the below configuration to angular.json is building the project in a more development friendly manner and logging the file names and line numbers in the console once more.

"serve": {
  "builder": "@angular-devkit/build-angular:dev-server",
  "configurations": {
    "production": {
      "browserTarget": "angular12:build:production"
    },
    "development": {
      "browserTarget": "angular12:build:development"
    }
  },
  "defaultConfiguration": "development"
},
will
  • 11
  • 2