Speeding up hot-reloads of webpack-dev-server #18444
Unanswered
MarkyMarkMcDonald
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Hello, do you use Maybe we can cache some things in Also I see you use |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Versions:
Webpack version: 5.91.0
(dev-server and dev-middleware are also at latest released versions).
Node version: 20.5.1
Problem
Our webpack configuration is for 259 entrypoints. We use webpack-dev-server in development and making any change takes 6-8 seconds to recompile, even when only adding or removing a blank line to a single file. I took a node profile and things that stick out are
buildChunkGraph
taking 1.7 seconds andSplitChunksPlugin
taking 2.5 seconds.Profile: webpack-51-hot-empty-lines.cpuprofile
If I change our config to only use 20 entrypoints then things are much faster. It seems like the reload is redoing a bunch of work considering no imports are being changed (so there shouldn't be any changes to chunking) - is there any way I can configure webpack to say "hey don't try to change / recalculate chunks as part of a hot reload"?
I'd also welcome any advice on what to look into further or ways to get more actionable logs / profiles.
Beta Was this translation helpful? Give feedback.
All reactions