-
Notifications
You must be signed in to change notification settings - Fork 6
/
.babelrc
29 lines (27 loc) · 924 Bytes
/
.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
{
// standard presets applying various plugins
presets: [
"env", // babel-preset-env: supporting es2015, es2016, and es2017 (with configuration)
"react" // babel-preset-react: react and jsx
],
// explicit plugins NOT part of the presets (above) ... prefer this over yearly presets
plugins: [
"transform-object-rest-spread", // "object rest properties" (es2018 Stage 4)
// ... ex: myFn({p1, p2, ...restParms})
],
// additional plugins explicitly called out via the BABEL_ENV variable
// ... see: build scripts in package.json
env: {
// BABEL_ENV=commonjs ... our CommonJS distribution (promoted in lib/ directory)
commonjs: {
plugins: [
["transform-es2015-modules-commonjs", { loose: true }]
]
},
// BABEL_ENV=es ... for our ES distribution (promoted in lib/ directory)
es: {
plugins: [
]
},
}
}