-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathbabel.config.js
35 lines (33 loc) · 1.01 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
module.exports = function (api) {
api.cache(true);
const presets = [
[
'@babel/preset-env',
{
modules: false,
loose: true,
bugfixes: true,
useBuiltIns: false,
},
],
[
'@babel/preset-react',
{
runtime: 'classic',
},
],
'@babel/preset-typescript',
];
const plugins = [
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
['@babel/plugin-proposal-class-properties', {loose: true}],
'@babel/plugin-proposal-export-default-from',
'@babel/plugin-proposal-function-sent',
'@babel/plugin-proposal-export-namespace-from',
'@babel/plugin-syntax-dynamic-import',
['@babel/plugin-transform-classes', { loose: true }],
['@babel/plugin-transform-runtime', { corejs: false, helpers: true, regenerator: true }],
['import', { libraryName: 'antd', libraryDirectory: 'es', style: 'css' }, 'antd'],
];
return { presets, plugins, ignore: [/[\/\\]core-js/, /@babel[\/\\]runtime/]};
};