-
Notifications
You must be signed in to change notification settings - Fork 3
/
.babelrc.js
45 lines (44 loc) · 1.16 KB
/
.babelrc.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
42
43
44
45
const cfg = require('./config')
module.exports = {
presets: [
['env', {
// Dynamically targeted feature transpilation
targets: {
browsers: cfg.get('BROWSER_SUPPORT')
},
// Enable conditional polyfilling babel-polyfill
useBuiltIns: true,
// For Webpack tree shaking
modules: false
}],
'react'
],
// Jest-specific config
env: {
test: {
presets: [
['env', {
// Target the minimum Node version as defined in package.json engines.node key
targets: {
node: 9
}
}]
]
}
},
// These are plugins for JS standard proposals that aren't yet fully
// standardised but are well worth using now anyway. Anything that's already
// fully standardised is covered by the env preset above
plugins: [
// import()
'syntax-dynamic-import',
// @decorators (legacy) - must be listed BEFORE class properties
'transform-decorators-legacy',
// Static class properties & ES2016 property initialiser syntax - loose to maintain compatibility with legacy decorators
['transform-class-properties', { 'loose': true }],
// {...object}
'transform-object-rest-spread',
// Export default from
'transform-export-default'
]
}