-
Notifications
You must be signed in to change notification settings - Fork 29
/
.babelrc
60 lines (60 loc) · 1.45 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
{
"presets": [
[
"@babel/preset-env"
],
[
"@babel/preset-react",
{
"useBuiltIns": true,
"useSpread": true,
"runtime": "automatic",
"importSource": "@emotion/react"
}
]
],
// Override preset-env for test because tests run on Node
// and Node needs commonJS imports
"env": {
"test": {
"presets": [
[
"@babel/preset-env",
{
"targets": {
"esmodules": false
}
}
],
[
"@babel/preset-react",
{
"useBuiltIns": true,
"useSpread": true,
"runtime": "automatic",
"importSource": "@emotion/react"
}
],
// For testing, we use babel's TS compiler instead of tsc
// The alternative would be hacking ts-node into the flow which
// hasn't worked so far.
"@babel/preset-typescript"
],
"plugins": [
"@emotion",
[
"module-name-mapper",
{
"moduleNameMapper": {
"^src/(.*)": "<pkgDir>/src/$1"
}
}
],
// Seem to require these even though https://github.com/babel/babel/issues/10690 is closed?
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-optional-chaining"
]
}
},
"plugins": ["@emotion", "@babel/plugin-transform-runtime"]
}