Skip to content

Commit

Permalink
fix(rspack): only patchChunkSplit when config set exposes
Browse files Browse the repository at this point in the history
  • Loading branch information
2heal1 committed Oct 21, 2024
1 parent cf14509 commit 83c3f44
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/tricky-sheep-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/rspack': patch
---

fix(rspack): only patchChunkSplit when config set exposes
9 changes: 6 additions & 3 deletions packages/rspack/src/ModuleFederationPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ export class ModuleFederationPlugin implements RspackPluginInstance {
}
this._checkSingleton(compiler);
this._patchBundlerConfig(compiler);
this._patchChunkSplit(compiler, options.name);
const containerManager = new ContainerManager();
containerManager.init(options);

if (containerManager.enable) {
this._patchChunkSplit(compiler, options.name);
}

options.implementation = options.implementation || RuntimeToolsPath;
let disableManifest = options.manifest === false;
Expand All @@ -79,8 +84,6 @@ export class ModuleFederationPlugin implements RspackPluginInstance {
}
if (!disableManifest && options.exposes) {
try {
const containerManager = new ContainerManager();
containerManager.init(options);
options.exposes = containerManager.containerPluginExposesOptions;
} catch (err) {
if (err instanceof Error) {
Expand Down

0 comments on commit 83c3f44

Please sign in to comment.