From 47c03b09ec57dd35b7d7c071e5642513a66a21be Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Thu, 13 Jan 2022 18:40:53 +0100 Subject: [PATCH] refactor(@angular-devkit/build-angular): exit early when there are no component style budgets With this change we exit the function early, when there are no budgets defined. (cherry picked from commit a35262e6a50cf3e07ee8a1711391612d74a650bf) --- .../webpack/plugins/any-component-style-budget-checker.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/angular_devkit/build_angular/src/webpack/plugins/any-component-style-budget-checker.ts b/packages/angular_devkit/build_angular/src/webpack/plugins/any-component-style-budget-checker.ts index f3f12be60583..ee5fb36691ff 100644 --- a/packages/angular_devkit/build_angular/src/webpack/plugins/any-component-style-budget-checker.ts +++ b/packages/angular_devkit/build_angular/src/webpack/plugins/any-component-style-budget-checker.ts @@ -37,6 +37,11 @@ export class AnyComponentStyleBudgetChecker { stage: Compilation.PROCESS_ASSETS_STAGE_ANALYSE, }, () => { + // No budgets. + if (this.budgets.length === 0) { + return; + } + // In AOT compilations component styles get processed in child compilations. if (!compilation.compiler.parentCompilation) { return;