-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build frontend with Vite #25874
Build frontend with Vite #25874
Conversation
Still a number of open chunk loading issues. If build performance does not improve, I don't think the switch will be worth it as it's a worse development experience. Even the dev server takes over 1 minute to start up, while webpack does the same in 20s. The majority of build time is spent in rollup, esbuild completes in around 5-10s. |
Around 30s of build time is allocated to Monaco, maybe https://github.com/vdesjs/vite-plugin-monaco-editor or https://twitter.com/youyuxi/status/1355316139144970240 is needed to bring that down. Or maybe vite has some way to cache specific dependencies. |
I haven't quite understood yet what the benefit about that would be, especially if it appears to be slower than webpack? |
@silverwind are you on windows? |
Mac |
So I don't think this will work out. Vite is really hard to integrate when it does not manage the HTML, likely the whole dev server needs a custom implementation as I can't figure out on which path it outputs the assets. While working on this I found two more issues:
The build is still massively slow because of big dependencies Monaco, Swagger-UI and Mermaid. I see no way to speed it up. No real idea why it's so much slower in Webpack, but Rollup seems like the most likely suspect, but it's a hard dependency of Vite unfortunately. |
I give up here. Until the speed issue is resolved, which imho can only come from evanw/esbuild#16 and vite adopting esbuild to bundle in place of rollup, but I guess it may take a few years for that to happen. I will follow up with the discovered issues, specifically the strict mode issue needs to be fixed anyways. #17793 (comment) outlines my reasons for not pursuing vite anymore. |
well another option and also modern would be https://turbo.build/pack but did not got it working for gitea jet |
Turbo is definitely on my radar, yes. I think the only thing that we are really missing currently with webpack is |
Maybe the slow build time is acceptable when it is never observed during development. The vite developers have promised to look into the slow prod build times. I will try to figure out the remaining issues with the dev server, will likely get rid of the |
Waiting on #25940. |
Will revisit this in a future version of Vite that will hopefully have increased the prod build speed. |
Work in progress, does not fully work yet. TODOs:
import declarations may only appear at top level of a module
_webpack_public_path
with renderBuiltUrlwebpackChunkName
sortablejs
warningInterestingly, vite is about 2-3 times as slow as webpack on my machine.
Fixes: #17793