-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.config.js
42 lines (42 loc) · 1.19 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
42
// eslint-disable-next-line no-undef
module.exports = {
// Common to all envs below.
plugins: [
// Makes sure babel does not include the same code snipped in each file,
// but imports helpers from a single module.
'@babel/plugin-transform-runtime',
['@babel/plugin-proposal-decorators', {legacy: true}],
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-numeric-separator',
'@babel/plugin-proposal-optional-catch-binding',
'@babel/plugin-proposal-throw-expressions'
],
presets: ['@babel/preset-react'],
// Used as the default for running babel-node scripts
env: {
development: {
sourceMaps: 'both',
presets: [
['@babel/preset-env', {
useBuiltIns: 'usage',
targets: {
node: 'current'
}
}]
]
},
// Jest runs with NODE_ENV=test and will use the following.
// We target the current node version to minimize transcompilation.
// This should speed up the test run and make it more debugable.
test: {
sourceMaps: 'both',
presets: [
['@babel/preset-env', {
targets: {
node: 'current'
}
}]
]
}
}
};