Skip to content

Commit e28c715

Browse files
committed
fix(@angular-devkit/build-angular): ignore css only chunks during naming
Don't name CSS only chunks. Closes #22769
1 parent a11c947 commit e28c715

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/angular_devkit/build_angular/src/webpack/plugins/named-chunks-plugin.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ export class NamedChunksPlugin {
2626
return;
2727
}
2828

29+
if ([...chunk.files.values()].every((f) => f.endsWith('.css'))) {
30+
// If all chunk files are CSS files skip.
31+
// This happens when using `import('./styles.css')` in a lazy loaded module.
32+
return undefined;
33+
}
34+
2935
const name = this.generateName(chunk);
3036
if (name) {
3137
chunk.name = name;

0 commit comments

Comments
 (0)