let targets = pkg.browserslist
const plugins = [
- ['@babel/plugin-transform-classes'],
- ['@babel/plugin-transform-runtime', {
- corejs: 3,
- helpers: true,
- useESModules: true,
+ ['@babel/transform-runtime', {
version: "^7.14.5",
- regenerator: false
+ regenerator: false,
+ useESModules: true
+ }],
+ ["polyfill-corejs3", {
+ "method": "usage-pure"
}]
]
if (node) {
- plugins.shift()
targets = 'maintained node versions'
}
include: 'src/**',
babelHelpers: 'runtime',
babelrc: false,
+ targets: targets,
presets: [['@babel/preset-env', {
modules: false,
- targets: targets || pkg.browserslist,
// useBuildins and plugin-transform-runtime are mutually exclusive
// https://github.com/babel/babel/issues/10271#issuecomment-528379505
// use babel-polyfills when released
useBuiltIns: false,
- bugfixes: true
+ bugfixes: true,
+ loose: true
}]],
plugins
})
plugins: [
resolve({ browser: !node }),
commonjs(),
- getBabelConfig(node && 'maintained node versions'),
+ getBabelConfig(node),
filesize(),
!min ? {} : terser({
mangle: {
preamble: headerShort
}
})
- ],
- // external: [/@babel\/runtime/, /@babel\/runtime-corejs3/]//['@babel/runtime', '@babel/runtime-corejs3']
+ ]
})
// [node, minified, esm]
"@babel/plugin-proposal-optional-chaining": "^7.14.5"
}
},
- "@babel/plugin-external-helpers": {
- "version": "7.14.5",
- "resolved": "https://registry.npmjs.org/@babel/plugin-external-helpers/-/plugin-external-helpers-7.14.5.tgz",
- "integrity": "sha512-q/B/hLX+nDGk73Xn529d7Ar4ih17J8pNBbsXafq8oXij0XfFEA/bks+u+6q5q04zO5o/qivjzui6BqzPfYShEg==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.14.5"
- }
- },
"@babel/plugin-proposal-async-generator-functions": {
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.14.5.tgz",
"@babel/helper-plugin-utils": "^7.14.5"
}
},
- "@babel/polyfill": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.12.1.tgz",
- "integrity": "sha512-X0pi0V6gxLi6lFZpGmeNa4zxtwEmCs42isWLNjZZDE0Y8yVfgu0T2OAHlzBbdYlqbW/YXVvoBHpATEM+goCj8g==",
- "dev": true,
- "requires": {
- "core-js": "^2.6.5",
- "regenerator-runtime": "^0.13.4"
- },
- "dependencies": {
- "core-js": {
- "version": "2.6.12",
- "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz",
- "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==",
- "dev": true
- }
- }
- },
"@babel/preset-env": {
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.14.5.tgz",
"regenerator-runtime": "^0.13.4"
}
},
- "@babel/runtime-corejs3": {
- "version": "7.14.5",
- "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.14.5.tgz",
- "integrity": "sha512-cBbwXj3F2xjnQJ0ERaFRLjxhUSBYsQPXJ7CERz/ecx6q6hzQ99eTflAPFC3ks4q/IG4CWupNVdflc4jlFBJVsg==",
- "dev": true,
- "requires": {
- "core-js-pure": "^3.14.0",
- "regenerator-runtime": "^0.13.4"
- }
- },
"@babel/template": {
"version": "7.8.6",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz",
}
}
},
- "core-js-pure": {
- "version": "3.14.0",
- "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.14.0.tgz",
- "integrity": "sha512-YVh+LN2FgNU0odThzm61BsdkwrbrchumFq3oztnE9vTKC4KS2fvnPmcx8t6jnqAyOTCTF4ZSiuK8Qhh7SNcL4g==",
- "dev": true
- },
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"dependencies": {
"jsesc": {
"version": "0.5.0",
- "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
+ "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
"integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=",
"dev": true
}
},
"devDependencies": {
"@babel/core": "^7.14.5",
- "@babel/plugin-external-helpers": "^7.14.5",
- "@babel/plugin-transform-classes": "^7.14.5",
"@babel/plugin-transform-runtime": "^7.14.5",
- "@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.14.5",
- "@babel/runtime": "^7.14.5",
- "@babel/runtime-corejs3": "^7.14.5",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^19.0.0",
"@rollup/plugin-multi-entry": "^4.0.0",
"rollup-plugin-terser": "^7.0.2",
"typescript": "^4.3.2",
"yargs": "^17.0.1",
- "svgdom": "^0.1.8"
+ "svgdom": "^0.1.8",
+ "babel-plugin-polyfill-corejs3": "^0.2.2"
},
- "browserslist": [
- "last 2 version",
- "> 0.25%",
- "not ie 11",
- "not dead"
- ],
- "dependencies": {}
+ "browserslist": "last 2 version and > 0.25% and not op_mini all and not ie 11"
}