Skip to content

ant-design-vue takes a long time to cold start in the vite build tool #5822

@core-admin

Description

@core-admin
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.2.6

Environment

window10 node:v16.13.0 vue:^3.2.37

Reproduction link

https://github.com/core-admin/ant-design-vue-vite-app-load-test.git

Steps to reproduce

在使用vite搭建项目时,引入ant-design-vue作为UI,在vite冷启动时,发现页面打开缓慢,使用vite提供的--debug参数,看了下启动耗时,发现主要的耗时时间都花费在了@ant-design/icons-vue的构建身份,平均每一个icons js文件的耗时为3000ms ,有个疑问,vite冷启动时,把@ant-design/icons-vue包中的全局文件做了一个预构建,是ant-design-vue底层在使用这个包时,全量引入了吗,没有批构建。

处理@ant-design/icons-vue耗时:平均时长在60s-80s左右

db13803b44065149511fe6775ce0564
2cb42981fc81bf0bf339307b8c9075e

对比了一下市面上其他几个UI,均在git仓库中进行了依赖安装,平均耗时如下:

naive-ui:

90f520d31086e3dc54842ad954ba8c1

@arco-design/web-vue:

8351e2dae762723a8fe9e33ebe75203

element-plus:

image

What is expected?

冷启动的的耗时缩减(想请教下作者,耗时久的原因大概在哪,有什么优化或者解决方法吗)

What is actually happening?

冷启动耗时太久

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions