Replies: 6 comments 24 replies
-
Available using: https://vitejs.dev/config/#optimizedeps-include |
Beta Was this translation helpful? Give feedback.
-
We already have 1600 files and it's getting a pain to worth with the project. Build time is extremely fast, yet loading in the browser is very slow. We might even pass 3K files based on our expansion plans. We would also welcome this feature very much. |
Beta Was this translation helpful? Give feedback.
-
I want to chime in that we are facing the same problem. On dev the initial page load fetches ~3.6K files... This is an insane amount. |
Beta Was this translation helpful? Give feedback.
-
Anyone make any progress on this or have idea how to improve it? This is a huge pain point for devs of large projects. |
Beta Was this translation helpful? Give feedback.
-
I really can't understand why vite can't check every file from its cache at startup to see if it's still valid, and send them all in a single payload in dev mode regardless of if they're going to be used. Cost would be pretty minimal. Then vite runtime in browser would use the cache instead of a request first if possible until first cache invalidation. what https://github.com/antfu/vite-plugin-prebundle does feels so logical; hope it would be finished/working in more cases. What is the hidden reason this is not yet the default; it kinda baffles me compared to how popular / widespread it is. I know it's probably an overly optimistic estimation, but it really feels like a 2 day poc from one core vite contributor IMO. (not really a rant, but a personal comment I feel may be useful to hear): Vite is awesome, I love it... BUT: the sad part is that every year, I look for a solution to this very issue, and come to the same sad conclusion that vite is either not that "smart" or not properly maintained. And people around me too now have the mentality of "let's just wait for some better tool". Slow desillusion for such a cool project. If anyone want to attempt to fix that user-land, I guess it is probably doable with some web worker local to your projects, intercepting requests, returning some local cached version "synchronously", while still sending the request to check if things changed to invalidate things. may be tricky, but feels worth trying at this point. and thanks for the cool project anyway :) |
Beta Was this translation helpful? Give feedback.
-
Is there any estimate time of release for Rolldown (+ vite integration of rolldown)? |
Beta Was this translation helpful? Give feedback.
-
Currently, vite doesn't perform well with large projects with a lot of modules (1000+) on
dev
mode. The bottleneck is on the browser side:The bundled app is less than 50KB but it requires a lot of dependencies (I'll provide a sample repo soon). So currently vitejs cannot be used for large or very fine grained applications 😢
We could probably fix it by bundling and caching on the fly some of the modules. It's not an simple task, but this could help a lot to scale vitejs.
Other ideas or solutions ?
Beta Was this translation helpful? Give feedback.
All reactions