按这个配置打包 会报错

package.json 中的版本信息也提供下
{ "name": "@icedesign/pro-scaffold", "version": "2.3.1", "files": [ "src/", "build/", "public/", "tests/", "_gitignore", ".editorconfig", ".eslintignore", ".eslintrc" ], "dependencies": { "@ahooksjs/use-request": "^2.8.15", "@alifd/meet-react": "^2.0.0", "@alifd/next": "^1.19.23", "@alifd/theme-dark-pro": "^0.1.0", "@antv/data-set": "^0.9.5", "@babel/core": "7.17.5", "@babel/plugin-proposal-class-properties": "^7.16.7", "@builder/pack": "^0.6.0", "@ice/form": "^0.1.7", "@ice/runtime": "^0.1.1", "@ice/store": "^1.4.3", "@icedesign/balloon-confirm": "^1.0.4", "@icedesign/container": "^1.x", "@icedesign/data-binder": "^1.x", "@icedesign/dynamic-icon": "^0.1.8", "@icedesign/ellipsis": "^1.x", "@icedesign/form-binder": "^1.0.3", "@icedesign/foundation-symbol": "^1.0.0", "@icedesign/img": "^1.0.0", "@icedesign/label": "^1.x", "@icedesign/layout": "^1.x", "@icedesign/theme": "^0.x", "@icedesign/title": "^1.0.2", "@kenshooui/react-multi-select": "^1.1.5", "@khanacademy/react-multi-select": "^0.3.3", "@loadable/component": "^5.15.2", "@react-pdf/renderer": "^1.6.5", "@vitejs/plugin-react": "^1.2.0", "axios": "^0.17.1", "better-picker": "^1.1.3", "bizcharts": "^3.2.2", "bizgoblin": "0.0.1", "brace": "^0.11.1", "buffer": "^6.0.3", "classnames": "^2.2.5", "copy-to-clipboard": "^3.2.0", "core-js": "^3.6.5", "create-app-shared": "^1.2.3", "echarts": "^4.2.1", "echarts-liquidfill": "^1.0.5", "enquire-js": "^0.1.2", "history": "^4.7.2", "hoist-non-react-statics": "^2.5.5", "immutable": "^4.0.0-rc.12", "intl": "^1.2.5", "invariant": "^2.2.4", "is-hotkey": "^0.1.4", "lodash": "^4.17.10", "moment": "^2.23.0", "path-to-regexp": "^2.2.1", "prop-types": "^15.5.8", "query-string": "^7.1.1", "rax": "^1.1.0", "react": "^16.2.0", "react-ace": "^9.1.1", "react-app-renderer": "^3.1.0", "react-better-picker": "^0.0.6", "react-document-title": "^2.0.3", "react-dom": "^16.4.1", "react-helmet": "^6.1.0", "react-intl": "^2.8.0", "react-markdown": "^4.0.8", "react-redux": "^5.1.2", "react-router": "latest", "react-router-dom": "^4.2.2", "react-router-redux": "5.0.0-alpha.6", "react-syntax-highlighter": "^12.2.1", "react-vcode": "^1.0.4", "redux": "^4.1.2", "redux-thunk": "^2.3.0", "regenerator-runtime": "^0.13.9", "rollup": "^2.0.0", "sass": "1.49.9", "shortid": "^2.2.15", "sql-formatter": "^2.3.3", "stream-browserify": "^3.0.0", "vite": ">=2.0.0", "webpack": "^5.70.0" }, "devDependencies": { "babel-eslint": "^8.0.3", "babel-plugin-syntax-dynamic-import": "^6.18.0", "build-plugin-css-assets-local": "^0.1.0", "build-plugin-fusion": "^0.1.0", "build-plugin-ice-auth": "2.0.1", "build-plugin-moment-locales": "^0.1.0", "cssnano": "^4.1.10", "cz-conventional-changelog": "^3.2.0", "eslint": "^4.13.1", "eslint-config-airbnb": "^16.1.0", "eslint-plugin-babel": "^4.1.1", "eslint-plugin-import": "^2.8.0", "eslint-plugin-jsx-a11y": "^6.0.3", "eslint-plugin-react": "^7.5.1", "happypack": "^5.0.1", "ice.js": "^2.0.0", "optimize-css-assets-webpack-plugin": "^5.0.3", "standard-version": "^6.0.1" }, "scripts": { "start": "icejs start --config ./build.config.js --port 4444 --mode dev", "dev:community": "icejs start --config ./build.config.js --port 4444 --mode community", "build": "icejs build --config ./build.config.js --mode prod", "build:community": "node --max-old-space-size=8192 ./node_modules/.bin/icejs build --mode community", "lint": "eslint . --ext '.js,.jsx' --fix", "release": "standard-version" }, "publishConfig": { "access": "public" }, "scaffoldConfig": { "builder": "ice-scripts", "name": "ice-design-pro", "title": "ICE Design Pro", "categories": [ "基础模板" ], "screenshot": "https://img.alicdn.com/tfs/TB1xYm7w9zqK1RjSZPcXXbTepXa-2872-1580.png", "defaultLayout": "BasicLayout" }, "engines": { "node": ">=8.0.0" }, "title": "arkcontrol_web", "iceworks": { "adapter": "adapter-react-v2" }, "ideMode": { "name": "ice-react" } }
怎么解决呢这个问题
确认有问题 我们修复下
需要多久啊
阻塞型 bug 我们会尽快修复,可以关注这个 issue 的动态
问题原因: css-loader 4.0 版本 开始 即便是绝对地址也会对图片 url 进行获取
临时处理,新增一个插件配置 url 属性:
const path = require('path');
module.exports = ({ onGetWebpackConfig }) => {
onGetWebpackConfig((config) => {
['css', 'scss', 'scss-module'].forEach((rule) => {
config.module
.rule(rule)
.use('css-loader')
.tap((options) => {
return {
...options,
url: {
filter: (url) => {
return !path.isAbsolute(url);
},
},
};
});
});
});
};
后续 ice.js 版本中将会兼容类似问题