Replies: 2 comments 1 reply
-
Great question! I stuck here too, the JS size (without tree shaking) is actually big not "micro" enough. |
Beta Was this translation helpful? Give feedback.
-
did this was solved? use module federation and check output,i was also confusing about bundle size,it's seems not exclude dependencies from MF configuration eg: new ModuleFederationPlugin({
name: 'hostApp',
remotes: {
remoteApp: 'remoteApp@static/remoteApp.js',
},
shared: {
'@zenlayer/zen-design': { singleton: true },
'@zenlayer/zen-design-pro': { singleton: true },
antd: { singleton: true },
},
}), //host
new ModuleFederationPlugin({
name: 'remoteApp',
library: { type: 'umd', name: 'remoteApp' },
filename: 'static/remoteApp.js',
exposes: {
'./entry': './src/remoteEntry',
},
shared: {
react: { singleton: true, eager: true },
'react-dom': { singleton: true, eager: true },
antd: { singleton: true },
},
}), in this configuration webpack will bundle dependecies each project and remoteEntry: why caused this,what is the essential condition of module federation exclude bundld and how i check it |
Beta Was this translation helpful? Give feedback.
-
Hello,
I have a simple setup like shell -> appRoute -> libs. When I generate the remote entries I have appRouteRemoteEntry.js and libsRemoteEntry.js but when I use the bundle analyzer I see both remote entries contain vendor code like react, react-dom. I also used the
shared
feature module federation. My question is could we specify the run time chunk and load theshared
vendor code beforehand so each remote entry can only contain the source code?Beta Was this translation helpful? Give feedback.
All reactions