From 2f814e0c6bada0e14d8abc1e720127b4316cb954 Mon Sep 17 00:00:00 2001 From: Yan Wang Date: Tue, 10 Dec 2024 19:43:52 +0800 Subject: [PATCH] add polyfill for querystring --- tools/scripts-config-react-webpack/config/webpack.config.js | 2 +- tools/scripts-config-react-webpack/package.json | 1 + .../.storybook-templates/main.js | 2 +- tools/scripts-config-storybook-lib/package.json | 5 +++-- yarn.lock | 5 +++++ 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/scripts-config-react-webpack/config/webpack.config.js b/tools/scripts-config-react-webpack/config/webpack.config.js index 34a952f9947..81e2a2a1f85 100644 --- a/tools/scripts-config-react-webpack/config/webpack.config.js +++ b/tools/scripts-config-react-webpack/config/webpack.config.js @@ -287,7 +287,7 @@ module.exports = ({ getUserConfig, mode }) => { fallback: { url: false, path: false, - querystring: false, + querystring: require.resolve('querystring-es3'), }, }, module: { diff --git a/tools/scripts-config-react-webpack/package.json b/tools/scripts-config-react-webpack/package.json index 6b272e51298..a8e29c56aa9 100644 --- a/tools/scripts-config-react-webpack/package.json +++ b/tools/scripts-config-react-webpack/package.json @@ -43,6 +43,7 @@ "postcss": "^8.4.47", "postcss-loader": "^8.1.1", "postcss-safe-parser": "^6.0.0", + "querystring-es3": "^0.2.1", "regenerator-runtime": "^0.13.11", "resolve-url-loader": "^5.0.0", "sass": "^1.80.5", diff --git a/tools/scripts-config-storybook-lib/.storybook-templates/main.js b/tools/scripts-config-storybook-lib/.storybook-templates/main.js index 1a4c6cb58c1..e12e7d4e96f 100644 --- a/tools/scripts-config-storybook-lib/.storybook-templates/main.js +++ b/tools/scripts-config-storybook-lib/.storybook-templates/main.js @@ -84,7 +84,7 @@ const defaultMain = { fallback: { ...config.resolve.fallback, path: false, - querystring: false, + querystring: require.resolve('querystring-es3'), }, }, }; diff --git a/tools/scripts-config-storybook-lib/package.json b/tools/scripts-config-storybook-lib/package.json index 0c6ea09eafd..5d8004c617a 100644 --- a/tools/scripts-config-storybook-lib/package.json +++ b/tools/scripts-config-storybook-lib/package.json @@ -24,19 +24,20 @@ "@storybook/addon-interactions": "^7.6.20", "@storybook/addon-links": "^7.6.20", "@storybook/addon-storysource": "^7.6.20", - "@storybook/source-loader": "^7.6.20", "@storybook/jest": "^0.2.3", "@storybook/preset-scss": "^1.0.3", "@storybook/react": "^7.6.20", "@storybook/react-webpack5": "^7.6.20", + "@storybook/source-loader": "^7.6.20", "@storybook/testing-library": "^0.2.2", - "@talend/scripts-config-react-webpack": "^16.8.1", "@talend/dynamic-cdn-webpack-plugin": "^14.0.0", + "@talend/scripts-config-react-webpack": "^16.8.1", "assert": "^2.1.0", "i18next-http-backend": "^1.4.5", "lodash": "^4.17.21", "msw": "^2.6.6", "msw-storybook-addon": "^2.0.4", + "querystring-es3": "^0.2.1", "storybook": "^7.6.20", "util": "^0.12.5" }, diff --git a/yarn.lock b/yarn.lock index a5894a5b960..bf86f1a5574 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15764,6 +15764,11 @@ qs@6.13.0, qs@^6.10.0, qs@^6.10.3, qs@^6.11.0, qs@^6.12.3: dependencies: side-channel "^1.0.6" +querystring-es3@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" + integrity sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA== + querystringify@^2.1.1: version "2.2.0" resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6"