-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.babelrc.js
43 lines (42 loc) · 873 Bytes
/
.babelrc.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
const env = process.env.BABEL_ENV
module.exports = {
presets: [
[
'@babel/preset-env',
{
bugfixes: true,
modules: env === 'es' ? false : 'auto',
},
],
'@babel/preset-react',
['@babel/preset-typescript', { isTSX: true, allExtensions: true }],
],
plugins: [
[
'@babel/plugin-transform-runtime',
{
useESModules: env === 'es' ? true : false,
},
],
'transform-class-properties',
['import', { libraryName: 'antd' }, 'antd'],
[
'import',
{
libraryName: 'lodash',
libraryDirectory: '',
camel2DashComponentName: false,
},
'lodash',
],
[
'import',
{
libraryName: '@ant-design/icons',
libraryDirectory: '',
camel2DashComponentName: false,
},
'@ant-design/icons',
],
],
}