forked from pelican-dev/panel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.config.js
34 lines (32 loc) · 913 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
module.exports = function (api) {
let targets = {};
const plugins = [
'babel-plugin-macros',
'styled-components',
'react-hot-loader/babel',
'@babel/transform-runtime',
'@babel/transform-react-jsx',
'@babel/proposal-class-properties',
'@babel/proposal-object-rest-spread',
'@babel/proposal-optional-chaining',
'@babel/proposal-nullish-coalescing-operator',
'@babel/syntax-dynamic-import',
];
if (api.env('test')) {
targets = { node: 'current' };
plugins.push('@babel/transform-modules-commonjs');
}
return {
plugins,
presets: [
'@babel/typescript',
['@babel/env', {
modules: false,
useBuiltIns: 'entry',
corejs: 3,
targets,
}],
'@babel/react',
]
};
};