Skip to content

Commit 9efc3cd

Browse files
alan-agius4filipesilva
authored andcommitted
fix(@angular-devkit/build-angular): don't dedupe linked modules
Closes #18021
1 parent 6547d15 commit 9efc3cd

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/angular_devkit/build_angular/src/angular-cli-files/plugins/dedupe-module-resolve-plugin.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ interface NormalModuleFactoryRequest {
1919
};
2020
descriptionFileRoot: string;
2121
descriptionFilePath: string;
22+
directory?: boolean;
23+
file?: boolean;
2224
}
2325

2426
export interface DedupeModuleResolvePluginOptions {
@@ -45,7 +47,13 @@ export class DedupeModuleResolvePlugin {
4547
return;
4648
}
4749

48-
// Only try to dedupe modules which have a name and a version
50+
// When either of these properties is undefined. It typically means it's a link.
51+
// In which case we shouldn't try to dedupe it.
52+
if (request.file === undefined || request.directory === undefined) {
53+
return;
54+
}
55+
56+
// Empty name or versions are no valid primary entrypoints of a library
4957
if (!request.descriptionFileData.name || !request.descriptionFileData.version) {
5058
return;
5159
}

0 commit comments

Comments
 (0)