Skip to content

Commit

Permalink
fix(angular): don't share angular mfe package
Browse files Browse the repository at this point in the history
  • Loading branch information
Coly010 committed Apr 29, 2022
1 parent 3abff91 commit af0cfd4
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/angular/src/utils/mfe/with-module-federation.ts
Original file line number Diff line number Diff line change
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,18 +151,20 @@ 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(
dependencies.workspaceLibraries
);

const npmPackages = sharePackages(
dependencies.npmPackages.filter(
(pkg) => !DEFAULT_NPM_PACKAGES_TO_AVOID.includes(pkg)
)
);
const npmPackages = sharePackages(dependencies.npmPackages);

DEFAULT_NPM_PACKAGES_TO_AVOID.forEach((pkgName) => {
if (pkgName in npmPackages) {
delete npmPackages[pkgName];
}
});

const sharedDependencies = {
...sharedLibraries.getLibraries(),
Expand Down

0 comments on commit af0cfd4

Please sign in to comment.