diff --git a/packages/core/src/plugins/moduleFederation.ts b/packages/core/src/plugins/moduleFederation.ts index 58ce0de0ab..3f6e120316 100644 --- a/packages/core/src/plugins/moduleFederation.ts +++ b/packages/core/src/plugins/moduleFederation.ts @@ -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')) {