-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: CRA fix for 'axios_1.default.post is not a function
Signed-off-by: Bucur David <dbucur22@gmail.com>
- Loading branch information
1 parent
5f51d09
commit 0abac70
Showing
3 changed files
with
92 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const getCacheIdentifier = require("react-dev-utils/getCacheIdentifier"); | ||
|
||
const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== "false"; | ||
|
||
module.exports = function override(config, webpackEnv) { | ||
console.log("overriding webpack config..."); | ||
|
||
const isEnvDevelopment = webpackEnv === "development"; | ||
const isEnvProduction = webpackEnv === "production"; | ||
const loaders = config.module.rules[1].oneOf; | ||
|
||
loaders.splice(loaders.length - 1, 0, { | ||
test: /\.(js|mjs|cjs)$/, | ||
exclude: /@babel(?:\/|\\{1,2})runtime/, | ||
loader: require.resolve("babel-loader"), | ||
options: { | ||
babelrc: false, | ||
configFile: false, | ||
compact: false, | ||
presets: [[require.resolve("babel-preset-react-app/dependencies"), { helpers: true }]], | ||
cacheDirectory: true, | ||
// See #6846 for context on why cacheCompression is disabled | ||
cacheCompression: false, | ||
// @remove-on-eject-begin | ||
cacheIdentifier: getCacheIdentifier(isEnvProduction ? "production" : isEnvDevelopment && "development", [ | ||
"babel-plugin-named-asset-import", | ||
"babel-preset-react-app", | ||
"react-dev-utils", | ||
"react-scripts", | ||
]), | ||
// @remove-on-eject-end | ||
// Babel sourcemaps are needed for debugging into node_modules | ||
// code. Without the options below, debuggers like VSCode | ||
// show incorrect code and set breakpoints on the wrong lines. | ||
sourceMaps: shouldUseSourceMap, | ||
inputSourceMap: shouldUseSourceMap, | ||
}, | ||
}); | ||
|
||
return config; | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters