-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig-overrides.js
More file actions
27 lines (24 loc) · 834 Bytes
/
config-overrides.js
File metadata and controls
27 lines (24 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import getCacheIdentifier from 'react-dev-utils/getCacheIdentifier.js'; // Note the '.js' extension
export default function override(config, webpackEnv) {
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: 'babel-loader',
options: {
babelrc: false,
configFile: false,
compact: false,
presets: [
[
'babel-preset-react-app/dependencies',
{ helpers: true },
],
],
cacheDirectory: true,
},
});
return config;
}