You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Module Federation plugin currently introduces runtime code to each of the entrypoints that are defined in the bundler config. I'm working in a project that has several entrypoints, with one special entrypoint being responsible for determining which application to load. This special entrypoint doesn't share any code with the other entrypoints, and is intended to be as small as possible.
I'm trying to introduce Module Federation to the project, but one blocker is that currently the special entrypoint now includes all the eagerly shared dependencies and the module federation runtime. The entrypoint doesn't need any of these, and its bundle size is quite a bit larger now.
Is there a way to exclude a particular entrypoint from Module Federation, so that it doesn't receive the runtime or any eagerly loaded modules?
Suggested solution
In the ModuleFederationPlugin there could either be a entries or excludeEntries array to control which entrypoint chunks would be participating in federation.
entry: {special: './src/entrypoints/special.ts','application-one': './src/entrypoints/application-one.ts','application-two': './src/entrypoints/application-two.ts',},plugins: [newModuleFederationPlugin({entries: ['application-one','application-two']// Only provide the federation runtime to these chunks})]
Or
entry: {special: './src/entrypoints/special.ts','application-one': './src/entrypoints/application-one.ts','application-two': './src/entrypoints/application-two.ts',},plugins: [newModuleFederationPlugin({excludeEntries: ['special']// Specifically exclude this entrypoint from participating in federation})]
Alternative
No response
Additional context
The project I'm working on uses rspack as a bundler
Clear and concise description of the problem
The Module Federation plugin currently introduces runtime code to each of the entrypoints that are defined in the bundler config. I'm working in a project that has several entrypoints, with one special entrypoint being responsible for determining which application to load. This special entrypoint doesn't share any code with the other entrypoints, and is intended to be as small as possible.
I'm trying to introduce Module Federation to the project, but one blocker is that currently the special entrypoint now includes all the eagerly shared dependencies and the module federation runtime. The entrypoint doesn't need any of these, and its bundle size is quite a bit larger now.
Is there a way to exclude a particular entrypoint from Module Federation, so that it doesn't receive the runtime or any eagerly loaded modules?
Suggested solution
In the
ModuleFederationPlugin
there could either be aentries
orexcludeEntries
array to control which entrypoint chunks would be participating in federation.Or
Alternative
No response
Additional context
The project I'm working on uses
rspack
as a bundlerValidations
The text was updated successfully, but these errors were encountered: