Replies: 1 comment
-
Maybe you can create small example? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello all 👋
I'm working on a React app and I'm trying to make optimizations to my frontend build with webpack@5.
The goal is to split heavy node_modules dependencies and only load them when needed using dynamic
import()
andReact.lazy
.Ideally I'd like to have :
Here is my splitChunks configuration :
It kind of work but it's pretty unpredictable, in some cases heavy deps that I expect to have lazy-loaded are still included in my vendors.bundle.js.
For example, I have a component "Chat" which is using the dependency "stream-chat-react". I lazy-loaded this component, a chunk was created but without including the dependency "stream-chat-react" which is stuck in my vendors.bundle.js :
stream-chat-react
is only used in my componentChat
and its sub-components, so I have no idea why it's not bundled with it.If you have any idea, I'll be very grateful. 👍
Beta Was this translation helpful? Give feedback.
All reactions