建立时间过长10分钟

问题描述

其中一个react应用程序花费太多时间来构建生产内容

package.json的内容如下

{
  "name": "app","version": "1.0.0","private": true,"dependencies": {
    "@date-io/date-fns": "^1.3.13","@date-io/moment": "^1.3.13","@material-ui/core": "^4.9.7","@material-ui/icons": "^4.9.1","@material-ui/lab": "^4.0.0-alpha.46","@material-ui/pickers": "^3.2.10","@testing-library/jest-dom": "^4.2.4","@testing-library/react": "^9.3.2","@testing-library/user-event": "^7.1.2","@types/react": "^16.9.53","axios": "0.19.2","clsx": "^1.1.0","currency-formatter": "^1.5.5","date-fns": "^2.0.0-beta.5","env-cmd": "^10.1.0","file-saver": "^2.0.2","human-format": "^0.11.0","jwt-decode": "^2.2.0","lodash": "^4.17.15","material-table": "^1.69.1","material-ui-chip-input": "^2.0.0-beta.2","moment": "^2.24.0","numeral": "^2.0.6","password-validator": "^5.0.3","plotly.js": "^1.53.0","query-string": "^6.12.1","react": "^16.13.1","react-dom": "^16.13.1","react-google-charts": "^3.0.15","react-plotly.js": "^2.4.0","react-preloaders": "^3.0.3","react-redux": "^7.2.0","react-router-dom": "^5.1.2","react-scripts": "^3.4.3","react-window": "^1.8.5","redux": "^4.0.5","redux-thunk": "^2.3.0","validate.js": "^0.13.1","xlsx": "^0.16.1"
  },"scripts": {
    "start": "env-cmd -f .env.development react-scripts --max_old_space_size=4096 start","build": "react-scripts --max_old_space_size=4096 build","build:prod": "env-cmd -f .env.production react-scripts --max_old_space_size=4096 build","build:test": "env-cmd -f .env.test react-scripts --max_old_space_size=4096 build","test": "react-scripts test","eject": "react-scripts eject"
  },"eslintConfig": {
    "extends": "react-app"
  },"browserslist": {
    "production": [
      ">0.2%","not dead","not op_mini all"
    ],"development": [
      "last 1 chrome version","last 1 firefox version","last 1 safari version"
    ]
  },"devDependencies": {
    "@material-ui/styles": "^4.10.0","eslint-plugin-react": "^7.21.5"
  }
}

在github上的反应线程之后,实际上也开始使用--max_old_space_size=4096,这出于某些原因是很奇怪的,因为我没有使用任何其他几乎共享相同程度复杂性的项目。其他应用程序始终可以在3分钟内正常运行。但是,此特定项目大约需要9-10分钟来构建生产内容

我到目前为止所做的事情: 删除未使用的进口 仅导入代码所需的特定功能。 构建大小仍为3MB,构建时间约为10分钟

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...