2

vite 编译速度没有宣传的那么快啊!

 1 year ago
source link: https://www.v2ex.com/t/873639
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

公司项目使用 vue3 来开发的,但是使用 vite 打包需要 15 分钟。运行 dev 环境也需要 3 分钟,搞不懂是什么问题!

本人 mac pro 打包需要 5 分钟左右,前端同事打包都需要 15 分钟

有大佬帮忙分析一下,如何优化项目打包速度,测试每次发布前端都要等 15 分钟

  • 项目大小 600M ,我以前 vue2 项目 900 多 M 也没有这么慢
  • vite.config.js 里面也没有什么配置项目
  • package.json 依赖项也不是太多
{
  "dependencies": {
    "@antv/g6": "^4.6.4",
    "@element-plus/icons-vue": "0.2.6",
    "@fortawesome/fontawesome-free": "^6.1.1",
    "@vueuse/core": "^7.5.5",
    "axios": "0.24.0",
    "codemirror": "^5.65.3",
    "diff-match-patch": "^1.0.5",
    "echarts": "5.2.2",
    "element-plus": "2.0.1",
    "file-saver": "2.0.5",
    "fuse.js": "6.4.6",
    "js-cookie": "3.0.1",
    "jsencrypt": "3.2.1",
    "lodash": "^4.17.21",
    "mitt": "^3.0.0",
    "nprogress": "0.2.0",
    "uuid": "^8.3.2",
    "vue": "3.2.26",
    "vue-cropper": "1.0.2",
    "vue-router": "4.0.12",
    "vuex": "4.0.2"
  },
  "devDependencies": {
    "@types/lodash": "^4.14.181",
    "@vitejs/plugin-vue": "1.9.4",
    "@vue/compiler-sfc": "3.2.22",
    "sass": "1.45.0",
    "unplugin-auto-import": "0.5.3",
    "unplugin-element-plus": "^0.3.4",
    "vite": "2.6.14",
    "vite-plugin-compression": "0.3.6",
    "vite-plugin-svg-icons": "1.0.5",
    "vite-plugin-vue-setup-extend": "0.1.0"
  }
}

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK