-
Notifications
You must be signed in to change notification settings - Fork 398
/
babel.config.js
41 lines (41 loc) · 1.29 KB
/
babel.config.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
36
37
38
39
40
41
module.exports = {
// https://babeljs.io/docs/en/assumptions
'assumptions': {
'setPublicClassFields': true,
},
'presets': [
[
// https://babeljs.io/docs/en/babel-preset-env
'@babel/preset-env',
{
// Allow `@babel/preset-env` to import polyfills from core-js as needed.
'useBuiltIns': 'usage',
// Help `@babel/preset-env` make use of the correct core-js polyfills.
'corejs': '3.23',
// Perform transforms closest to targets defined in `.browserslistrc`.
'bugfixes': true,
},
],
'@babel/preset-flow',
// https://babeljs.io/docs/en/babel-preset-react/
[
'@babel/preset-react',
{
// When spreading props, use inline object with spread elements directly
// instead of Babel's extend helper or Object.assign.
'useBuiltIns': true,
// FIXME: Upgrade to React 17+
// Cannot use React 17 new, lighter, faster JSX Transform
// https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html
// https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md#motivation
// 'runtime': 'automatic',
},
],
],
'plugins': [],
'env': {
'test': {
'plugins': ['dynamic-import-node'],
},
},
};