Closed pan724597965 closed 4 months ago
提问前先看看:
https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md
我单独引入pro-components组件库,本地打包构建时一直提示部分pro组件路径找不到, 报错信息和package.json如下图 node版本 16.x npm版本 6.x
package.json内容如下: { "name": "webapp", "private": true, "version": "0.0.0", "devDependencies": { "@babel/core": "7.9.6", "@hot-loader/react-dom": "17.0.2", "@types/history": "4.7.5", "@types/react": "17.0.80", "@types/react-dom": "17.0.25", "@types/react-helmet": "5.0.15", "@types/react-redux": "7.1.28", "@types/react-router": "5.1.20", "@types/react-router-dom": "5.1.9", "@types/webpack": "4.41.12", "@types/webpack-env": "1.15.2", "aspnet-prerendering": "3.0.1", "babel-loader": "8.1.0", "babel-plugin-import": "1.13.0", "case-sensitive-paths-webpack-plugin": "2.3.0", "css-loader": "3.5.3", "cssnano": "4.1.10", "file-loader": "6.0.0", "fork-ts-checker-webpack-plugin": "4.1.3", "ignore-loader": "0.1.2", "mini-css-extract-plugin": "0.9.0", "node-noop": "1.0.0", "node-sass": "4.14.1", "optimize-css-assets-webpack-plugin": "5.0.3", "react-dev-utils": "10.2.1", "react-hot-loader": "4.13.1", "rimraf": "3.0.2", "sass-loader": "8.0.2", "style-loader": "1.2.1", "terser-webpack-plugin": "3.0.1", "ts-loader": "7.0.3", "ts-nameof": "4.2.2", "ts-nameof-loader": "1.0.2", "typescript": "^4.9.5", "url-loader": "4.1.0", "webpack": "4.43.0", "webpack-cli": "3.3.11", "webpack-dev-middleware": "3.7.2", "webpack-hot-middleware": "2.25.0", "webpack-merge": "4.2.2", "aspnet-webpack-react": "4.0.0" }, "dependencies": { "@ant-design/pro-components": "^2.7.10", "@reduxjs/toolkit": "1.3.6", "antd": "^5.18.3", "aspnet-webpack": "3.0.0", "awesome-debounce-promise": "2.1.0", "axios": "0.19.2", "connected-react-router": "6.9.3", "core-js": "^3.37.1", "custom-event-polyfill": "1.0.7", "domain-wait": "^1.3.0", "event-source-polyfill": "1.0.12", "formik": "2.4.6", "history": "4.10.1", "nval-tippy": "^1.0.40", "query-string": "6.12.1", "rc-field-form": "^1.22.0", "react": "17.0.2", "react-dom": "17.0.2", "react-helmet": "6.1.0", "react-redux": "^7.1.0", "react-router": "5.3.4", "react-router-dom": "5.3.4", "redux": "4.0.5", "redux-thunk": "2.3.0", "sass": "1.26.5", "serialize-javascript": "^4.0.0", "umi-request": "^1.4.0" }, "scripts": { "postinstall": "node download.js --uri=https://github.com/sass/node-sass/releases/download/v4.14.1/linux-x64-72_binding.node --path=node_modules/node-sass/vendor/linux-x64-72/binding.node", "build:dev": "node build.before.js --mode=development && node ./node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js && node ./node_modules/webpack/bin/webpack.js --config webpack.config.js", "build:prod": "node build.before.js --mode=production && node ./node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js --env.prod=true && node ./node_modules/webpack/bin/webpack.js --config webpack.config.js --env.prod=true" } }
报错截图:
提问前先看看:
https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md
🧐 问题描述
我单独引入pro-components组件库,本地打包构建时一直提示部分pro组件路径找不到, 报错信息和package.json如下图 node版本 16.x npm版本 6.x
💻 示例代码
package.json内容如下: { "name": "webapp", "private": true, "version": "0.0.0", "devDependencies": { "@babel/core": "7.9.6", "@hot-loader/react-dom": "17.0.2", "@types/history": "4.7.5", "@types/react": "17.0.80", "@types/react-dom": "17.0.25", "@types/react-helmet": "5.0.15", "@types/react-redux": "7.1.28", "@types/react-router": "5.1.20", "@types/react-router-dom": "5.1.9", "@types/webpack": "4.41.12", "@types/webpack-env": "1.15.2", "aspnet-prerendering": "3.0.1", "babel-loader": "8.1.0", "babel-plugin-import": "1.13.0", "case-sensitive-paths-webpack-plugin": "2.3.0", "css-loader": "3.5.3", "cssnano": "4.1.10", "file-loader": "6.0.0", "fork-ts-checker-webpack-plugin": "4.1.3", "ignore-loader": "0.1.2", "mini-css-extract-plugin": "0.9.0", "node-noop": "1.0.0", "node-sass": "4.14.1", "optimize-css-assets-webpack-plugin": "5.0.3", "react-dev-utils": "10.2.1", "react-hot-loader": "4.13.1", "rimraf": "3.0.2", "sass-loader": "8.0.2", "style-loader": "1.2.1", "terser-webpack-plugin": "3.0.1", "ts-loader": "7.0.3", "ts-nameof": "4.2.2", "ts-nameof-loader": "1.0.2", "typescript": "^4.9.5", "url-loader": "4.1.0", "webpack": "4.43.0", "webpack-cli": "3.3.11", "webpack-dev-middleware": "3.7.2", "webpack-hot-middleware": "2.25.0", "webpack-merge": "4.2.2", "aspnet-webpack-react": "4.0.0" }, "dependencies": { "@ant-design/pro-components": "^2.7.10", "@reduxjs/toolkit": "1.3.6", "antd": "^5.18.3", "aspnet-webpack": "3.0.0", "awesome-debounce-promise": "2.1.0", "axios": "0.19.2", "connected-react-router": "6.9.3", "core-js": "^3.37.1", "custom-event-polyfill": "1.0.7", "domain-wait": "^1.3.0", "event-source-polyfill": "1.0.12", "formik": "2.4.6", "history": "4.10.1", "nval-tippy": "^1.0.40", "query-string": "6.12.1", "rc-field-form": "^1.22.0", "react": "17.0.2", "react-dom": "17.0.2", "react-helmet": "6.1.0", "react-redux": "^7.1.0", "react-router": "5.3.4", "react-router-dom": "5.3.4", "redux": "4.0.5", "redux-thunk": "2.3.0", "sass": "1.26.5", "serialize-javascript": "^4.0.0", "umi-request": "^1.4.0" }, "scripts": { "postinstall": "node download.js --uri=https://github.com/sass/node-sass/releases/download/v4.14.1/linux-x64-72_binding.node --path=node_modules/node-sass/vendor/linux-x64-72/binding.node", "build:dev": "node build.before.js --mode=development && node ./node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js && node ./node_modules/webpack/bin/webpack.js --config webpack.config.js", "build:prod": "node build.before.js --mode=production && node ./node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js --env.prod=true && node ./node_modules/webpack/bin/webpack.js --config webpack.config.js --env.prod=true" } }
🚑 其他信息
报错截图: