Skip to content

Commit 1deefa8

Browse files
authored
chore: modify the babel configuration (#6532)
* chore: modify the babel configuration * fix: 参考 antd-tools 的代码
1 parent 045193e commit 1deefa8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

antd-tools/getBabelCommonConfig.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { resolve } = require('./utils/projectHelper');
1+
const { resolve, isThereHaveBrowserslistConfig } = require('./utils/projectHelper');
22

33
module.exports = function (modules) {
44
const plugins = [
@@ -38,9 +38,11 @@ module.exports = function (modules) {
3838
resolve('@babel/preset-env'),
3939
{
4040
modules,
41-
targets: {
42-
browsers: ['last 2 versions', 'Firefox ESR', '> 1%', 'not ie 11'],
43-
},
41+
targets: isThereHaveBrowserslistConfig()
42+
? undefined
43+
: {
44+
browsers: ['last 2 versions', 'Firefox ESR', '> 1%', 'ie >= 11'],
45+
},
4446
},
4547
],
4648
],

0 commit comments

Comments
 (0)