2

This is what my profiler is showing for an Angular 7 app, built with angular-cli.

profiler schreenshot

Every function call is bundled under zone.js, and I cannot get useful information on what runs and for how long.


The app is running with: ng serve, and I think is in debug mode:

in main.ts

if (environment.production) {
  console.log('production mode!');
  enableProdMode();
} else {
  console.log('debug mode!');

At runtime, enableProdMode() doesn't get called.

I thought that my angular.json configures webpack to run in production mode, but it is the exact same as a new project with ng new (diff'ed them), except adding some external scripts + scss files.

RaidenF
  • 3,411
  • 4
  • 26
  • 42
  • 1
    Looks like sourcemaps aren't generated or aren't recognized/used by devtools. – wOxxOm Feb 12 '19 at 12:24
  • @wOxxOm good idea. I tried it with `ng serve --source-map` and it didn't have any difference. Also, sourcemaps must work, because the Sources tab properly shows my code, not the bundled one. – RaidenF Feb 12 '19 at 13:00
  • Same issue here, but with Vue.js. And sourcemaps work in the sources tab... – Cobertos Jun 09 '20 at 19:31

1 Answers1

2

The tool I was looking for is now called Javascript Profiler in chrome Dev Tools (it's hidden in the three dots menu on the top right).

enter image description here

RaidenF
  • 3,411
  • 4
  • 26
  • 42