-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig-overrides.js
35 lines (31 loc) · 1.07 KB
/
config-overrides.js
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
28
29
30
31
32
33
34
35
const rewirePostCSS = require('react-app-rewire-postcss');
const {
// See:
// https://github.com/arackaf/customize-cra/blob/master/api.md
override,
// adjustStyleLoaders,
// addPostcssPlugins,
addBabelPlugins,
// addBabelPlugin,
// addExternalBabelPlugins,
// addExternalBabelPlugin,
// addDecoratorsLegacy,
// fixBabelImports,
// useBabelRc,
} = require('customize-cra');
// const postCssNested = require('postcss-nested');
// Documentation for operators:
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining
module.exports = (config, _env) => {
override(
// useBabelRc(), // < alternative to addBabelPlugins ?
addBabelPlugins(
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-optional-chaining',
),
// addPostcssPlugins([postCssNested]), // < use this, instead of react-app-rewire-postcss ?
)(config);
rewirePostCSS(config, true);
return config;
};