chore: babel useBuiltIns usage

This commit is contained in:
thinkinggis 2019-12-20 10:08:01 +08:00
parent 6fa20f16e7
commit 5aa79bd440
2 changed files with 2 additions and 7 deletions

View File

@ -42,7 +42,8 @@ module.exports = api => {
[ [
'@babel/env', '@babel/env',
{ {
useBuiltIns: isCDNBundle ? 'usage' : false, // https://babeljs.io/docs/en/babel-preset-env#usebuiltins
useBuiltIns: 'usage',
// set `modules: false` when building CDN bundle, let rollup do commonjs works // set `modules: false` when building CDN bundle, let rollup do commonjs works
// @see https://github.com/rollup/rollup-plugin-babel#modules // @see https://github.com/rollup/rollup-plugin-babel#modules
modules: (isCDNBundle || isESModule) ? false : 'auto' modules: (isCDNBundle || isESModule) ? false : 'auto'
@ -66,11 +67,6 @@ module.exports = api => {
legacy: true legacy: true
} }
], ],
[ '@babel/plugin-transform-runtime',
{
regenerator: true
}
],
[ [
'@babel/plugin-proposal-class-properties', '@babel/plugin-proposal-class-properties',
{ {

View File

@ -13,7 +13,6 @@
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.4.4", "@babel/plugin-proposal-nullish-coalescing-operator": "^7.4.4",
"@babel/plugin-proposal-object-rest-spread": "^7.7.4", "@babel/plugin-proposal-object-rest-spread": "^7.7.4",
"@babel/plugin-proposal-optional-chaining": "^7.6.0", "@babel/plugin-proposal-optional-chaining": "^7.6.0",
"@babel/plugin-transform-runtime": "^7.7.6",
"@babel/preset-env": "^7.5.5", "@babel/preset-env": "^7.5.5",
"@babel/preset-react": "^7.0.0", "@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "^7.3.3", "@babel/preset-typescript": "^7.3.3",