Skip to content

Commit acf1e5e

Browse files
alan-agius4clydin
authored andcommitted
fix(@angular-devkit/build-angular): don't rename blocks which have a name
When using the unsupported `webpackChunkName` magic comment we renamed the chunk which in some cases causes a runtime error. Closes #22525 (cherry picked from commit de14293)
1 parent 7a49397 commit acf1e5e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ export class NamedChunksPlugin {
4141
continue;
4242
}
4343

44+
if (block.groupOptions.name) {
45+
// Ignore groups which have been named already.
46+
return undefined;
47+
}
48+
4449
for (const dependency of block.dependencies) {
4550
if (dependency instanceof ImportDependency) {
4651
return Template.toPath(dependency.request);

0 commit comments

Comments
 (0)