Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/nice-crews-beg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/modern-js': patch
---

fix(modernjs): auto set enableAsyncEntry when bundler is rspack
4 changes: 4 additions & 0 deletions packages/modernjs/src/cli/configPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ export const moduleFederationConfigPlugin = (
FEDERATION_IPV4: JSON.stringify(ipv4),
REMOTE_IP_STRATEGY: JSON.stringify(userConfig.remoteIpStrategy),
},
enableAsyncEntry:
bundlerType === 'rspack'
? modernjsConfig.source?.enableAsyncEntry ?? true
: modernjsConfig.source?.enableAsyncEntry,
},
dev: {
assetPrefix: modernjsConfig?.dev?.assetPrefix
Expand Down
9 changes: 0 additions & 9 deletions packages/modernjs/src/cli/ssrPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,7 @@ export const moduleFederationSSRPlugin = (
return { entrypoint, plugins };
},
config: async () => {
const bundlerType =
useAppContext().bundlerType === 'rspack' ? 'rspack' : 'webpack';

return {
source: {
enableAsyncEntry:
bundlerType === 'rspack'
? modernjsConfig.source?.enableAsyncEntry ?? true
: modernjsConfig.source?.enableAsyncEntry,
},
tools: {
rspack(config, { isServer }) {
if (isServer) {
Expand Down