-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbabel.config.js
executable file
·37 lines (34 loc) · 977 Bytes
/
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
module.exports = api => {
const env = api.env();
const isTest = api.cache(() => env === 'test');
const presets = [
[
'@babel/env',
{
targets: isTest
? { node: 'current' }
: {
browsers: [
'last 1 chrome versions',
'last 1 safari versions',
'last 1 edge versions',
'last 1 firefox versions',
],
},
modules: isTest ? 'commonjs' : false,
},
],
'@babel/react',
'@babel/typescript',
];
const plugins = [
'react-hot-loader/babel',
'@babel/plugin-proposal-class-properties',
'babel-plugin-styled-components',
'babel-plugin-lodash',
];
return {
presets,
plugins,
};
};