Skip to content

Commit

Permalink
fix(misc): shared deps that rely on default configuration are filtere…
Browse files Browse the repository at this point in the history
…d out

The issue was introduced by #15654. It then filters out and omits shared deps that rely on default
configuration when return value from `shared` function is `undefined`.

closed #15811
  • Loading branch information
Dmitry Marcautan committed Apr 10, 2023
1 parent 9690c0b commit 8ca24cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/angular/src/utils/mf/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ export async function getModuleFederationConfig(

if (mfConfig.shared) {
dependencies.workspaceLibraries = dependencies.workspaceLibraries.filter(
(lib) => mfConfig.shared(lib.importKey, {})
(lib) => mfConfig.shared(lib.importKey, {}) !== false
);
dependencies.npmPackages = dependencies.npmPackages.filter((pkg) =>
mfConfig.shared(pkg, {})
dependencies.npmPackages = dependencies.npmPackages.filter(
(pkg) => mfConfig.shared(pkg, {}) !== false
);
}

Expand Down
6 changes: 3 additions & 3 deletions packages/react/src/module-federation/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ export async function getModuleFederationConfig(

if (mfConfig.shared) {
dependencies.workspaceLibraries = dependencies.workspaceLibraries.filter(
(lib) => mfConfig.shared(lib.importKey, {})
(lib) => mfConfig.shared(lib.importKey, {}) !== false
);
dependencies.npmPackages = dependencies.npmPackages.filter((pkg) =>
mfConfig.shared(pkg, {})
dependencies.npmPackages = dependencies.npmPackages.filter(
(pkg) => mfConfig.shared(pkg, {}) !== false
);
}

Expand Down

0 comments on commit 8ca24cb

Please sign in to comment.