我希望我的React应用程序可以投入生产。 我在尝试跑步时遇到了问题
yarn build
2天
尝试安装3.14 terser版本,将terser添加到package.json的分辨率块中,删除package.json.lock或yarn.lock文件。删除node_modules
文件夹并使用npm。
顺便说一句,纱线制造对新项目来说效果很好。
Terser出现错误,名称应为
https://i.stack.imgur.com/HDZR9.png
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.18.0",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-ionicons": "^3.0.1",
"react-redux": "^7.0.3",
"react-router-dom": "^5.0.0",
"react-scripts": "3.0.1",
"react-spinners": "^0.5.4",
"redux": "^4.0.1",
"redux-thunk": "^2.3.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"resolutions": {
"terser": "3.14.1"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}