Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): ignore css only chunks during naming
Browse files Browse the repository at this point in the history
Don't name CSS only chunks.

Closes #22769

(cherry picked from commit e28c715)
  • Loading branch information
alan-agius4 committed Mar 4, 2022
1 parent d82d0eb commit 90a5531
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ export class NamedChunksPlugin {
return;
}

if ([...chunk.files.values()].every((f) => f.endsWith('.css'))) {
// If all chunk files are CSS files skip.
// This happens when using `import('./styles.css')` in a lazy loaded module.
return undefined;
}

const name = this.generateName(chunk);
if (name) {
chunk.name = name;
Expand Down

0 comments on commit 90a5531

Please sign in to comment.