Skip to content

Commit

Permalink
fix: fix production build issue with cra 5
Browse files Browse the repository at this point in the history
This is an insane for such a small issue but there is no alternative for the time being.
See facebook/create-react-app#11756 and related PR facebook/create-react-app#11764.
  • Loading branch information
lutangar committed Aug 17, 2022
1 parent 2b9653f commit 9f7753e
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 6 deletions.
7 changes: 7 additions & 0 deletions config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = function override(config) {
config.resolve.fallback = {
querystring: require.resolve('querystring-es3'),
};

return config;
};
45 changes: 44 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
"history": "^5.1.0",
"lighten-darken-color": "^1.0.0",
"node-polyfill-webpack-plugin": "^2.0.0",
"querystring-es3": "^0.2.1",
"react": "^17.0.2",
"react-animate-height": "^2.0.23",
"react-app-rewired": "^2.2.1",
"react-dom": "^17.0.2",
"react-fontawesome": "^1.7.1",
"react-modal": "^3.14.4",
Expand Down Expand Up @@ -58,10 +60,10 @@
"react-error-overlay": "^6.0.9"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-app-rewired eject",
"lint": "eslint '**/*.{js,ts,tsx}'",
"lint:staged": "lint-staged -d",
"lint:fix": "eslint --fix '**/*.{js,ts,tsx}'",
Expand All @@ -78,7 +80,11 @@
"prettier",
"unused-imports"
],
"ignorePatterns": ["build/", "site/", "node_modules/"],
"ignorePatterns": [
"build/",
"site/",
"node_modules/"
],
"rules": {
"react-hooks/rules-of-hooks": "error",
"import/order": "error",
Expand Down

0 comments on commit 9f7753e

Please sign in to comment.