-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Description
Is your feature request related to a problem? Please describe.
The biggest problem in vite performace is the number of files served to the browser, this becomes very big in case most of your code is placed in workspaces (which are not prebundled by vite)
To decrease the number of es modules served in big monorepos Vite could prebundle workspaces dependencies to signle files (still with node modules externalized, to prevent duplication of dependencies)
Describe the solution you'd like
Bundle workspaces in single files bundles
On workspace files change, rebundle the files again
React refresh and other plugins would still be applied, this means that workspaces would need to be bundled with rollup instead of esbuild
Describe alternatives you've considered
Additional context
This would allow to set typescript or vue files as main for internal packages, which would remove a lot of tooling in a typical private monorepo