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

vite首次启动加载慢 #185

Open
xlearns opened this issue Jul 17, 2022 · 0 comments
Open

vite首次启动加载慢 #185

xlearns opened this issue Jul 17, 2022 · 0 comments

Comments

@xlearns
Copy link
Owner

xlearns commented Jul 17, 2022

参考

解决方案

  • 预构建
    • vite 只搜索了最外层的 ant-design-vue 的引用,如果我们引用的是这个 package 跟深级别的包,则无法自动加入预构建,这时候就需要手动配置下
    //  vite.config.js
    {
     optimizeDeps: {
       include: ["ant-design-vue/es/locale/zh_CN"];
     }

}
```

  • https
  • 关掉没用的浏览器插件
  • 使用 https 2
    • https1.1,chrome 只允许 6 个同时并发,当我们在 vite 中配置了 server.https 为 ture 时,会自动使用 node 中的 http 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant