Skip to content

Commit 90a5531

Browse files
committedMar 4, 2022
fix(@angular-devkit/build-angular): ignore css only chunks during naming
Don't name CSS only chunks. Closes #22769 (cherry picked from commit e28c715)
1 parent d82d0eb commit 90a5531

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

+6
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)
Please sign in to comment.