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
This commit is contained in:
Alan Agius 2022-02-21 11:31:12 +01:00 committed by Charles
parent 748d3ab2e5
commit de14293083

View File

@ -41,6 +41,11 @@ export class NamedChunksPlugin {
continue;
}
if (block.groupOptions.name) {
// Ignore groups which have been named already.
return undefined;
}
for (const dependency of block.dependencies) {
if (dependency instanceof ImportDependency) {
return Template.toPath(dependency.request);