以上方案,根据以下package.json配置{
"private": true,
"scripts": {
"analyze": "cross-env ANALYZE=1 umi build",
"start": "cross-env UMI_ENV=local umi dev",
"build:dev": "cross-env UMI_ENV=dev umi build",
"build:test": "cross-env UMI_ENV=test umi build",
"build:uat": "cross-env UMI_ENV=uat umi build",
"build:prod": "cross-env UMI_ENV=prod umi build",
"check:model": "umi dva list model",
"postinstall": "umi generate tmp",
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
"test": "umi-test",
"test:coverage": "umi-test --coverage"
},
"gitHooks": {
"pre-commit": "lint-staged"
},
"engines": {
"node": ">= 16.14.0"
},
"lint-staged": {
"*.{js,jsx,less,md,json}": [
"prettier --write"
],
"*.ts?(x)": [
"prettier --parser=typescript --write"
]
},
"dependencies": {
"@ant-design/pro-layout": "^6.5.0",
"antd": "4.24.0",
"antd-img-crop": "^3.16.0",
"axios": "^1.6.8",
"braft-editor": "^2.3.9",
"braft-extensions": "^0.1.1",
"classnames": "^2.2.6",
"clipboard": "^2.0.8",
"crypto-js": "^4.1.1",
"dva-model-extend": "^0.1.2",
"easy-email-core": "^4.16.1",
"easy-email-editor": "^4.16.1",
"jsencrypt": "3.2.1",
"less-vars-to-js": "^1.3.0",
"locales": "^0.0.2",
"lodash": "^4.17.21",
"lrz": "^4.9.41",
"mjml-browser": "^4.15.3",
"moment": "^2.25.3",
"nprogress": "^0.2.0",
"react": "17.0.0",
"react-color": "^2.19.3",
"react-dnd": "^14.0.4",
"react-dom": "17.0.0",
"react-final-form": "^6.5.9",
"react-webcam": "^7.2.0",
"store": "2.0.12",
"umi": "3.5.20",
"yarn": "^1.22.22"
},
"devDependencies": {
"@lingui/babel-preset-react": "^2.9.0",
"@types/crypto-js": "^4.0.2",
"@types/lodash": "^4.14.176",
"@types/nprogress": "^0.2.0",
"@types/qs": "^6.9.7",
"@types/react": "17.0.0",
"@types/react-dom": "17.0.0",
"@typescript-eslint/eslint-plugin": "^5.2.0",
"@typescript-eslint/parser": "^5.2.0",
"@umijs/preset-react": "^2.1.7",
"cross-env": "^7.0.3",
"eslint": "^8.1.0",
"eslint-plugin-react": "^7.26.1",
"lint-staged": "^10.0.7",
"prettier": "^2.2.0",
"typescript": "^4.1.2",
"yorkie": "^2.0.0",
"zip-webpack-plugin": "^4.0.1"
},
"resolutions": {
"@types/react": "17.0.0",
"@types/react-dom": "17.0.0",
"immer": "9.0.7"
},
"preinstall": "npm install --package-lock-only --ignore-scripts && npx npm-force-resolutions"
},重新制定方案