-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbabel.config.js
47 lines (45 loc) · 1.12 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
43
44
45
46
47
/* eslint-env node */
module.exports = {
// Common to all envs below.
presets: ['@babel/preset-react'],
env: {
// Used as the default for running babel
development: {
presets: [
['@babel/preset-env', {
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'
}
}]
]
},
// Default env used for webpack when e.g. running the dev server.
// It will minimize transcompilation to target the
// latest browsers. This should allow easier debugging.
webpack: {
sourceMaps: 'both',
presets: [
['@babel/preset-env', {
modules: false,
useBuiltIns: 'usage',
targets: {
browsers: 'last 1 Chrome versions'
}
}]
]
}
}
};