diff --git a/packages/angular/src/utils/mfe/with-module-federation.ts b/packages/angular/src/utils/mfe/with-module-federation.ts index 6c46dfb91de23..52bf9d1e4a759 100644 --- a/packages/angular/src/utils/mfe/with-module-federation.ts +++ b/packages/angular/src/utils/mfe/with-module-federation.ts @@ -4,10 +4,10 @@ import { shareWorkspaceLibraries, } from './mfe-webpack'; import { - workspaceRoot, createProjectGraphAsync, ProjectGraph, readCachedProjectGraph, + workspaceRoot, Workspaces, } from '@nrwl/devkit'; import { @@ -151,7 +151,7 @@ function mapRemotes(remotes: MFERemotes) { } export async function withModuleFederation(options: MFEConfig) { - const DEFAULT_NPM_PACKAGES_TO_AVOID = ['zone.js']; + const DEFAULT_NPM_PACKAGES_TO_AVOID = ['zone.js', '@nrwl/angular/mfe']; const dependencies = await getDependentPackagesForProject(options.name); const sharedLibraries = shareWorkspaceLibraries( @@ -164,6 +164,12 @@ export async function withModuleFederation(options: MFEConfig) { ) ); + DEFAULT_NPM_PACKAGES_TO_AVOID.forEach((pkgName) => { + if (pkgName in npmPackages) { + delete npmPackages[pkgName]; + } + }); + const sharedDependencies = { ...sharedLibraries.getLibraries(), ...npmPackages,