Skip to content

Commit

Permalink
perf(mf): only patch split chunks for provider app (#3102)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Aug 1, 2024
1 parent 5473291 commit 87600a7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/core/src/plugins/moduleFederation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,11 @@ export function pluginModuleFederation(): RsbuildPlugin {
.use(rspack.container.ModuleFederationPlugin, [options]);

if (options.name) {
chain
.plugin('mf-patch-split-chunks')
.use(PatchSplitChunksPlugin, [options.name]);
if (options.exposes) {
chain
.plugin('mf-patch-split-chunks')
.use(PatchSplitChunksPlugin, [options.name]);
}

// `uniqueName` is required for react refresh to work
if (!chain.output.get('uniqueName')) {
Expand Down

0 comments on commit 87600a7

Please sign in to comment.