Skip to content

Commit 4f6cee2

Browse files
squelixalan-agius4
authored andcommitted
fix(@angular-devkit/build-angular): skip undefined files when generating budget stats
When the sourceMaps are enabled they are generating some files that are computed by the budget stats. Now the method `generateBudgetStats` skip when the file is undefined. (cherry picked from commit 9baae6e)
1 parent 482d0be commit 4f6cee2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/angular/build/src/tools/esbuild/budget-stats.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ export function generateBudgetStats(
6060

6161
// Add component styles from metafile
6262
// TODO: Provide this information directly from the AOT compiler
63-
for (const entry of Object.values(metafile.outputs)) {
63+
for (const [file, entry] of Object.entries(metafile.outputs)) {
64+
if (!file.endsWith('.css')) {
65+
continue;
66+
}
6467
// 'ng-component' is set by the angular plugin's component stylesheet bundler
6568
// eslint-disable-next-line @typescript-eslint/no-explicit-any
6669
const componentStyle: boolean = (entry as any)['ng-component'];

0 commit comments

Comments
 (0)