Modules Federation - cacheGroups shared modules #13953
Unanswered
neilnachman
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
We a have a React app where we are using dynamic imports for code splitting each route/page of the app.
We are using optimization.splitChunks for cache group node_modules but only the ones that needed for the initial load. (without the node_modules that used only by the lazy loaded chunks)
Something like
When trying to implement module federation, the App act as a shell and we are sharing around 80 modules. This is leading for around 80 files loaded on the initial load.
I’m guessing that these files are not consider as initial chunks anymore because setting the optimization.splitChunks configuration above does not effect anymore.
When changing the configuration to:
It does combine everything to one big vendors chunks but now it also includes the node_modules that are used only by the lazy loaded routes and not needed for the initial load, so we ended with a much bigger vendors chunk over what we had before added the ModulesFederation plugin.
Any suggestion for how to implement this correctly?
We want to have one vendors chunk that includes only node_modules that are needed for the initial load.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions