buqiyuan / electron-vite-monorepo

Electron Turborepo monorepo with pnpm, Vue, Vite boilerplate
https://buqiyuan.github.io/electron-vite-monorepo/
MIT License
698 stars 180 forks source link

开发本地运行超级慢 #11

Closed 1014156094 closed 3 months ago

1014156094 commented 2 years ago

image 开发的时候刷新页面后平均要等20秒才能显示,线上版本则没有这问题。

"dependencies": {
    "@ant-design/icons-vue": "^6.0.1",
    "@vueuse/core": "^7.6.2",
    "ant-design-vue": "^3.1.1",
    "axios": "^0.26.0",
    "dayjs": "^1.10.7",
    "file-saver": "^2.0.5",
    "lodash-es": "^4.17.21",
    "mitt": "^3.0.0",
    "nprogress": "^1.0.0-1",
    "pinia": "^2.0.11",
    "qiniu-js": "^3.4.0",
    "qs": "^6.10.3",
    "socket.io-client": "^4.4.1",
    "sortablejs": "^1.14.0",
    "vue": "^3.2.31",
    "vue-i18n": "^9.1.9",
    "vue-router": "^4.0.12",
    "xlsx": "^0.18.2"
  },
  "devDependencies": {
    "@commitlint/cli": "^16.2.1",
    "@commitlint/config-conventional": "^16.2.1",
    "@types/lodash-es": "^4.17.6",
    "@types/node": "^17.0.18",
    "@typescript-eslint/eslint-plugin": "^5.14.0",
    "@typescript-eslint/parser": "^5.14.0",
    "@vitejs/plugin-legacy": "^1.7.1",
    "@vitejs/plugin-vue": "^2.2.4",
    "@vitejs/plugin-vue-jsx": "^1.3.8",
    "commitizen": "^4.2.4",
    "consola": "^2.15.3",
    "eslint": "^8.10.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-define-config": "^1.2.5",
    "eslint-plugin-prettier": "^4.0.0",
    "eslint-plugin-vue": "^8.5.0",
    "gh-pages": "^3.2.3",
    "husky": "^7.0.4",
    "less": "^4.1.2",
    "lint-staged": "^12.3.4",
    "lodash-webpack-plugin": "^0.11.6",
    "mockjs": "^1.1.0",
    "postcss-html": "^1.3.0",
    "postcss-less": "^6.0.0",
    "prettier": "^2.5.1",
    "rollup-plugin-visualizer": "^5.6.0",
    "stylelint": "^14.5.3",
    "stylelint-config-prettier": "^9.0.3",
    "stylelint-config-recess-order": "^3.0.0",
    "stylelint-config-recommended-vue": "^1.3.0",
    "stylelint-config-standard": "^25.0.0",
    "typescript": "^4.6.2",
    "vite": "^2.9.1",
    "vite-plugin-compression": "^0.5.1",
    "vite-plugin-mock": "^2.9.6",
    "vite-plugin-style-import": "^2.0.0",
    "vite-plugin-svg-icons": "^2.0.1",
    "vite-plugin-windicss": "^1.8.3",
    "vue-eslint-parser": "^8.3.0",
    "windicss": "^3.5.1"
  },

系统:win11

buqiyuan commented 2 years ago

我觉得你们很多人对vite的“快”有一些误解哈!具体我就不在这里赘述了。当然,优化的点还是有的,但优化的余地不多,由于个人原因,暂时还没有时间针对这方面进行有效的优化,你可以参考网上的一些解决方案以及尤大对webpack和vite的客观解释

1014156094 commented 2 years ago

我页面功能不多,就16个页面,一个页面就大概一个请求列表的接口

1014156094 commented 2 years ago

找到原因了,是依赖的 BUG 导致的,最早那批人下载的 pnpm-lock.yaml 有问题,删掉 pnpm-lock.yaml,重新 pnpm install 一下就好了。