Replies: 1 comment 14 replies
-
The issue isn't about awaiting. The current code is non-blocking when optimizing as you expect. Dependencies are optimized in batch because they share common chunks. When a new dependency is discovered, they all need to be re-optimized and if one of the common chunks between the old ones and the new ones changes... then the browser needs to reload because if not it could end up with duplicated state (think of internal react hooks state) Some more info expanded from this thread: https://twitter.com/patak_dev/status/1530239669652299782
|
Beta Was this translation helpful? Give feedback.
-
I've always wondered: why does Vite reload the page when new dependencies to be pre-optimized are discovered? I'm probably missing something but I'm curious: why is that?
Naively, I would think that Vite could delay the HTTP response until it finishes optimizing the dependency.
Beta Was this translation helpful? Give feedback.
All reactions