-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
SSR
: ssrLoadModule issue
#9436
Comments
😁 I think maybe I've figure out where is the problem: https://github.com/vitejs/vite/blob/main/packages/vite/src/node/ssr/ssrModuleLoader.ts#L253 This step is unnecessary for the deps that should be optimizatiered, e.g. antd/ lodash (这一步对于antd/lodash这种需要被预构建的依赖来说,是没有必要的) Because after deps optimization, the complex deps with so many modules(e.g. lodash, antd) has been build into I spent some time trying to understand the code, but it was a bit difficult for me to understand the context, so I didn't dare to pr, maybe I need the help of the maintainers cc @sapphi-red Thanks! |
Maybe there should an option to skip |
I still have this problem in the 3.1.6 version 🥲 |
The deps optimizer currently works for browsers only, so SSR doesn't use the bundles from |
Thank you for your reply. |
I'm also not a fan of |
Oh, I saw it this morning, and immediately forked it, tried it locally, and still no solution. |
Even using WSL or a VS Code devcontainer, the issue can't be avoided. Seems like it may not be just a Windows issue. It also affects every vite-based meta framework I've tried with. Rakkas, astro, qwik, etc. It seems like the only work around is to use a non-vite framework. Or to not use antd. |
|
I've checkout vite 4. For me, it's still took a long time to optimize deps. |
The PR doesn't fix SSR optimize deps, but only for |
Nice!!!!!!!!!!!!!!!!! ssr: {
optimizeDeps: {
include: ['antd', '...other heavy deps'],
disabled: 'build'
}
} Thank you very much! ❤️ @bluwy |
Thanks! Yes the performance has improved greatly for me with antd on vite-based frameworks using vite 4. I went from ~1m to 13-20s on Rakkas. I guess there's still work to be done on the prebundling performance. |
Describe the bug
description
I'm using
antd
inssr
mode, everytime startup vite devServer, it took about 40s to start.I've debug
vite
source code in local, and I found that the reason is: https://github.com/vitejs/vite/blob/main/packages/vite/src/node/server/transformRequest.ts#L234I tested three conditions:
BTW, I think this is not related to #8850.
Reproduction
https://github.com/hemengke1997/vps-antd-repo
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: