fix(@angular-devkit/build-angular): consider ascii_only terser setting when counting components in analytics

This commit is contained in:
Alan Agius 2020-09-03 19:50:01 +02:00
parent 4191912b86
commit ceeb6fba34

View File

@ -161,6 +161,8 @@ export class NgBuildAnalyticsPlugin {
this._stats.numberOfComponents += countOccurrences(module._source.source(), 'Component({');
// For Ivy we just count ɵcmp.
this._stats.numberOfComponents += countOccurrences(module._source.source(), '.ɵcmp', true);
// for ascii_only true
this._stats.numberOfComponents += countOccurrences(module._source.source(), '.\u0275cmp', true);
}
}
@ -172,6 +174,8 @@ export class NgBuildAnalyticsPlugin {
// Count the number of `.ɵccf(` strings (case sensitive). They're calls to components
// factories.
this._stats.numberOfComponents += countOccurrences(module._source.source(), '.ɵccf(');
// for ascii_only true
this._stats.numberOfComponents += countOccurrences(module._source.source(), '.\u0275ccf(');
}
}