You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by sh...@apache.org on 2025/04/03 09:38:03 UTC
(answer) 01/03: fix: development warning
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 <li...@sifou.com>
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(eslint@8.57.1)(typescript@4.9.5)
+ buffer:
+ specifier: 6.0.3
+ version: 6.0.3
customize-cra:
specifier: ^1.0.0
version: 1.0.0
@@ -2303,6 +2306,9 @@ packages:
balanced-match@1.0.2:
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
+ base64-js@1.5.1:
+ resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
+
batch@0.6.1:
resolution: {integrity: sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==}
@@ -2367,6 +2373,9 @@ packages:
buffer-from@1.1.2:
resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==}
+ buffer@6.0.3:
+ resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==}
+
builtin-modules@3.3.0:
resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==}
engines: {node: '>=6'}
@@ -3863,6 +3872,9 @@ packages:
resolution: {integrity: sha512-00n6YnVHKrinT9t0d9+5yZC6UBNJANpYEQvL2LlX6Ab9lnmxzIRcEmTPuyGScvl1+jKuCICX1Z0Ab1pPKKdikA==}
engines: {node: '>=4'}
+ ieee754@1.2.1:
+ resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}
+
ignore@5.3.2:
resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==}
engines: {node: '>= 4'}
@@ -9765,6 +9777,8 @@ snapshots:
balanced-match@1.0.2: {}
+ base64-js@1.5.1: {}
+
batch@0.6.1: {}
bfj@7.1.0:
@@ -9841,6 +9855,11 @@ snapshots:
buffer-from@1.1.2: {}
+ buffer@6.0.3:
+ dependencies:
+ base64-js: 1.5.1
+ ieee754: 1.2.1
+
builtin-modules@3.3.0: {}
builtins@5.1.0:
@@ -11593,6 +11612,8 @@ snapshots:
dependencies:
harmony-reflect: 1.6.2
+ ieee754@1.2.1: {}
+
ignore@5.3.2: {}
immer@9.0.21: {}