From 2dbaf7908eaa901b776e78d4e9ebd48afd3006f2 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Thu, 14 Nov 2019 13:18:15 +0100 Subject: [PATCH] fix(@angular-devkit/build-angular): fix numberOfComponents in JIT mode Current we are always sending `0` as the number of components in JIT mode because ` Component({` doesn't match the component source (cherry picked from commit d9420cbe40389ed008922f0024ce334c121e96e5) --- .../angular_devkit/build_angular/plugins/webpack/analytics.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/angular_devkit/build_angular/plugins/webpack/analytics.ts b/packages/angular_devkit/build_angular/plugins/webpack/analytics.ts index 7bf7f0a8ba2c..fe89ed24f6cf 100644 --- a/packages/angular_devkit/build_angular/plugins/webpack/analytics.ts +++ b/packages/angular_devkit/build_angular/plugins/webpack/analytics.ts @@ -158,7 +158,7 @@ export class NgBuildAnalyticsPlugin { // Count the number of `Component({` strings (case sensitive), which happens in __decorate(). // This does not include View Engine AOT compilation, we use the ngfactory for it. - this._stats.numberOfComponents += countOccurrences(module._source.source(), ' Component({'); + this._stats.numberOfComponents += countOccurrences(module._source.source(), 'Component({'); // For Ivy we just count ɵcmp. this._stats.numberOfComponents += countOccurrences(module._source.source(), '.ɵcmp', true); }