Skip to content

Commit

Permalink
fix(angular): don't share angular mfe package (#10059)
Browse files Browse the repository at this point in the history
  • Loading branch information
Coly010 authored and FrozenPandaz committed Apr 29, 2022
1 parent 8d9b90c commit 605b3dc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/angular/src/utils/mfe/with-module-federation.ts
Expand Up @@ -4,10 +4,10 @@ import {
shareWorkspaceLibraries,
} from './mfe-webpack';
import {
workspaceRoot,
createProjectGraphAsync,
ProjectGraph,
readCachedProjectGraph,
workspaceRoot,
Workspaces,
} from '@nrwl/devkit';
import {
Expand Down Expand Up @@ -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(
Expand All @@ -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,
Expand Down

0 comments on commit 605b3dc

Please sign in to comment.