This is an automated email from the ASF dual-hosted git repository. shuai pushed a commit to branch ui-optimization in repository https://gitbox.apache.org/repos/asf/answer.git
commit 1fcf0363e2004a4ec62fdaa753ee9914e6393e5e Author: shuai <[email protected]> AuthorDate: Tue Apr 1 18:17:23 2025 +0800 fix: development warning --- ui/config-overrides.js | 11 ++++++++++- ui/package.json | 1 + ui/pnpm-lock.yaml | 21 +++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/ui/config-overrides.js b/ui/config-overrides.js index 4ce6f895..7d62b1d8 100644 --- a/ui/config-overrides.js +++ b/ui/config-overrides.js @@ -21,7 +21,9 @@ const { addWebpackModuleRule, addWebpackAlias, setWebpackOptimizationSplitChunks, + addWebpackPlugin, } = require("customize-cra"); +const webpack = require('webpack'); const path = require("path"); const i18nPath = path.resolve(__dirname, "../i18n"); @@ -30,7 +32,8 @@ module.exports = { webpack: function(config, env) { addWebpackAlias({ "@": path.resolve(__dirname, "src"), - "@i18n": i18nPath + "@i18n": i18nPath, + buffer: 'buffer', })(config); addWebpackModuleRule({ @@ -38,6 +41,12 @@ module.exports = { use: "yaml-loader" })(config); + addWebpackPlugin( + new webpack.ProvidePlugin({ + Buffer: ['buffer', 'Buffer'], + }) + )(config); + setWebpackOptimizationSplitChunks({ maxInitialRequests: 20, minSize: 20 * 1024, diff --git a/ui/package.json b/ui/package.json index fdfe866b..b88fc12d 100644 --- a/ui/package.json +++ b/ui/package.json @@ -67,6 +67,7 @@ "@types/react-dom": "^18.0.6", "@typescript-eslint/eslint-plugin": "^6.11.0", "@typescript-eslint/parser": "^6.11.0", + "buffer": "6.0.3", "customize-cra": "^1.0.0", "eslint": "^8.53.0", "eslint-config-airbnb": "^19.0.4", diff --git a/ui/pnpm-lock.yaml b/ui/pnpm-lock.yaml index 26b676c9..842009a7 100644 --- a/ui/pnpm-lock.yaml +++ b/ui/pnpm-lock.yaml @@ -153,6 +153,9 @@ importers: '@typescript-eslint/parser': specifier: ^6.11.0 version: 6.21.0([email protected])([email protected]) + buffer: + specifier: 6.0.3 + version: 6.0.3 customize-cra: specifier: ^1.0.0 version: 1.0.0 @@ -2303,6 +2306,9 @@ packages: [email protected]: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + [email protected]: + resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + [email protected]: resolution: {integrity: sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==} @@ -2367,6 +2373,9 @@ packages: [email protected]: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + [email protected]: + resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} + [email protected]: resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} engines: {node: '>=6'} @@ -3863,6 +3872,9 @@ packages: resolution: {integrity: sha512-00n6YnVHKrinT9t0d9+5yZC6UBNJANpYEQvL2LlX6Ab9lnmxzIRcEmTPuyGScvl1+jKuCICX1Z0Ab1pPKKdikA==} engines: {node: '>=4'} + [email protected]: + resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + [email protected]: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} @@ -9765,6 +9777,8 @@ snapshots: [email protected]: {} + [email protected]: {} + [email protected]: {} [email protected]: @@ -9841,6 +9855,11 @@ snapshots: [email protected]: {} + [email protected]: + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + [email protected]: {} [email protected]: @@ -11593,6 +11612,8 @@ snapshots: dependencies: harmony-reflect: 1.6.2 + [email protected]: {} + [email protected]: {} [email protected]: {}
