Skip to content

Commit

Permalink
fix(angular): Module federation with Crystal enabled.
Browse files Browse the repository at this point in the history
Ensures that withModuleFederation does not try to read from project graph while it's being created
  • Loading branch information
ndcunningham committed Mar 7, 2024
1 parent 46592d7 commit a0b8f4a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/angular/src/utils/mf/with-module-federation-ssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { getModuleFederationConfig } from './utils';
export async function withModuleFederationForSSR(
options: ModuleFederationConfig
) {
if (global.NX_GRAPH_CREATION) {
return (config) => config;
}
const { sharedLibraries, sharedDependencies, mappedRemotes } =
await getModuleFederationConfig(options, {
isServer: true,
Expand Down
3 changes: 3 additions & 0 deletions packages/angular/src/utils/mf/with-module-federation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { getModuleFederationConfig } from './utils';
import ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');

export async function withModuleFederation(options: ModuleFederationConfig) {
if (global.NX_GRAPH_CREATION) {
return (config) => config;
}
const { sharedLibraries, sharedDependencies, mappedRemotes } =
await getModuleFederationConfig(options);

Expand Down

0 comments on commit a0b8f4a

Please sign in to comment.