Skip to content
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

每次刷新加载非常慢 #329

Closed
3 tasks done
carl-jin opened this issue Mar 7, 2021 · 7 comments
Closed
3 tasks done

每次刷新加载非常慢 #329

carl-jin opened this issue Mar 7, 2021 · 7 comments

Comments

@carl-jin
Copy link

carl-jin commented Mar 7, 2021

如下图所示, 我的配置在下方, 我不知道这是不是正常情况, 但是对比了vue-cli的项目, 这个还是有点慢呢, vue-cli的项目是都压成了一个chunks, 一次性加载
https://imgur.com/rxkSR85

  • Read the docs.
  • Make sure the code is up to date. (Some bugs have been fixed in the latest code)
  • This is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.

Describe the bug

A clear and concise description of what the bug is..

System Info

  • Operating System:window10
  • Node version:v14.15.0
  • Package manager (npm/yarn/pnpm) and version:6.14.8
  • "vite": "^2.0.5",
  • "vue": "^3.0.7",
  • "ant-design-vue": "2.0.1",
  • "vite-plugin-compression": "^0.2.3",
@anncwb
Copy link
Collaborator

anncwb commented Mar 7, 2021

请求多这个问题是vite机制的问题,刷新慢这个我已经在跟踪了,后面会解决

@JieyueCoding
Copy link

请问这个问题最终解决了吗,我现在把最新代码拿下来,本地启动项目加载时还是感觉挺慢的 有六七秒

@carl-jin
Copy link
Author

carl-jin commented Jun 5, 2021

请问这个问题最终解决了吗,我现在把最新代码拿下来,本地启动项目加载时还是感觉挺慢的 有六七秒

没解决,你可以把浏览器的devtool里面的disable cache关掉会快很多,另外因为vite的机制,基本上开发时刷新页面的情况很少

@freedomdebug
Copy link

请问有解决么,不是一般的慢

@carl-jin
Copy link
Author

请问有解决么,不是一般的慢

https://github.com/anncwb/vue-vben-admin/blob/e85649bde2378e8118099879392ff024da33e12b/build/vite/plugin/index.ts#L41
作者在最新的代码中已经暂时修复了这个问题

@Xiodra
Copy link

Xiodra commented Oct 27, 2021

@anncwb 这个问题貌似还是没能修复,vendor.*.js加载要好几秒

@carl-jin
Copy link
Author

最近把老项目从 webpack 迁移到 vite 时又遇到这个问题了,记录了下优化的方法, 虽然没有从实质上解决问题,但是也加速不少,https://carljin.com/vite-resolve-request-files-a-ton.html

@github-actions github-actions bot locked and limited conversation to collaborators Sep 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants