Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): skip undefined files when generat…
Browse files Browse the repository at this point in the history
…ing 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)
  • Loading branch information
Mickaël Depardon authored and alan-agius4 committed Jul 12, 2024
1 parent 482d0be commit 4f6cee2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/angular/build/src/tools/esbuild/budget-stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ export function generateBudgetStats(

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

0 comments on commit 4f6cee2

Please sign in to comment.