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

开发环境下可以优化启动性能吗? #301

Closed
luoyi58624 opened this issue Jan 28, 2022 · 15 comments
Closed

开发环境下可以优化启动性能吗? #301

luoyi58624 opened this issue Jan 28, 2022 · 15 comments

Comments

@luoyi58624
Copy link

在开发环境下,直接全局引入Element-plus非常快,但使用插件解析组件库则需要花非常多的时间,打开浏览器页面一直在转圈圈,vite不停地在解析依赖,整个过程需要花费10多秒的时间,如果再引入其他依赖,那么时间将增大到半分钟

@asasugar
Copy link

asasugar commented Feb 8, 2022

+1 , 并且element plus按需引入,重新dev项目,如果没有浏览过使用某个组件(如:ElCard)的页面,则声明会自动删除,实际上组件有使用,只是没有访问过使用该组件的页面就会自动删除声明

@asasugar
Copy link

asasugar commented Feb 8, 2022

cc @antfu

@asasugar
Copy link

asasugar commented Feb 8, 2022

image

@antfu
Copy link
Member

antfu commented Feb 8, 2022

It's not an issue of the plugin but rather Vite itself, we are already working on it vitejs/vite#6758

@balck-paint
Copy link

@antfu Is this problem solved? As of today, I have updated to the latest version, but it is still very slow

@satrong
Copy link
Contributor

satrong commented Mar 9, 2022

Is it possible to add configuration to use full import in dev mode?

@zzzMaple
Copy link

still found the same problem in vite2.9.0 beta-3

@luoyi58624
Copy link
Author

vite@2.9.0-beta.7已解决该问题

@Corgis
Copy link

Corgis commented May 23, 2022

vite@2.9.0-beta.7已解决该问题
你好请问现在有缓解么,我使用如下版本还是一样的很慢
"vite": "2.9.2",
"unplugin-auto-import": "^0.7.1",

@asasugar
Copy link

vite@2.9.0-beta.7已解决该问题
你好请问现在有缓解么,我使用如下版本还是一样的很慢
"vite": "2.9.2",
"unplugin-auto-import": "^0.7.1",

用2.9.5就行,除了第一次慢点,或者依赖重装的话,因为在加缓存,node_modules/.vite/deps下

@Corgis
Copy link

Corgis commented May 30, 2022

好的 十分感谢

用2.9.5就行,除了第一次慢点,或者依赖重装的话,因为在加缓存,node_modules/.vite/deps下

@llcat
Copy link

llcat commented Sep 6, 2022

"vite": "^3.0.9",
"unplugin-auto-import": "^0.11.2",
"unplugin-vue-components": "^0.22.4",

this issue still exist in vite 3.0+,now, i reslove it by full import in dev mode

@like0413
Copy link

"vite": "^4.1.4",
"unplugin-vue-components": "^0.24.1",

是的,现在还是如此,我不得不手动按需引入了

@beikeliu
Copy link

beikeliu commented Apr 23, 2023 via email

@shuqiang0
Copy link

我的一个很小的项目,开发环境首次加载时间能干到2-3分钟。UI库是ant-design-vue。体验极差。

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