This repository has been archived by the owner on May 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.babelrc
61 lines (52 loc) · 1.81 KB
/
.babelrc
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{
"presets": [
// Determines the polyfills we need based on browser version
["@babel/preset-env", {
// Disable module transformation—we don’t need it in Chrome
"modules": false,
"targets": {
"browsers": ["last 4 Chrome versions"]
},
// Trims down babel-polyfill to only the polyfills we need for our supported browsers
"useBuiltIns": "usage",
// Explicitly indicate which version of core-js we’re using—required for `useBuiltIns` option
corejs: 3,
}],
// Adds support for JSX
"@babel/preset-react",
],
"env": {
"test": {
// Required for Jest, which runs in node, which doesn’t support ES6 modules
"plugins": ["@babel/plugin-transform-modules-commonjs"]
}
},
"plugins": [
// Adds support for @decorators
// NOTE: Must be before plugin-proposal-class-properties
// See https://babeljs.io/docs/plugins/transform-decorators/
["@babel/plugin-proposal-decorators", {
"decoratorsBeforeExport": false,
}],
// Adds support for static class properties
// NOTE: Must be after plugin-proposal-decorators
// See https://babeljs.io/docs/plugins/transform-class-properties/
"@babel/plugin-proposal-class-properties",
// Adds support for the spread operator, e.g. `...props`
// See https://babeljs.io/docs/plugins/transform-object-rest-spread/
"@babel/plugin-proposal-object-rest-spread",
"lodash",
// Adds support for aliases in imports, e.g.
// import Foo from 'components/Foo'
// instead of
// import Foo from '../../../Foo'
// See https://github.com/tleunen/babel-plugin-module-resolver
["module-resolver", {
"alias": {
"components": "./src/components",
"src": "./src",
"test": "./test"
}
}],
]
}