Skip to content

Commit

Permalink
Merge pull request #11 from alex-oh/react-rewired-fix
Browse files Browse the repository at this point in the history
Fix breaking axios error
  • Loading branch information
alex-oh authored Jan 26, 2024
2 parents 0d68e3f + b6db7af commit 75a4689
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
13 changes: 13 additions & 0 deletions config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// workaround for `axios_1.default.create does not exist`
// Source: https://github.com/facebook/create-react-app/pull/12021#issuecomment-1108426483
module.exports = {
webpack: function (config, env) {
config.module.rules = config.module.rules.map(rule => {
if (rule.oneOf instanceof Array) {
rule.oneOf[rule.oneOf.length - 1].exclude = [/\.(js|mjs|jsx|cjs|ts|tsx)$/, /\.html$/, /\.json$/];
}
return rule;
});
return config;
},
}
27 changes: 27 additions & 0 deletions package-lock.json

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

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-scripts eject"
},
"eslintConfig": {
Expand All @@ -37,5 +37,8 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"react-app-rewired": "^2.2.1"
}
}

0 comments on commit 75a4689

Please sign in to comment.