现在@ babel / polyfill只是core-js v2的别名
.babelrc
{
"presets": [
[
"@babel/env",
{
"useBuiltIns": "usage",
"targets": {
"ie": "11",
"edge": "17",
"firefox": "60",
"chrome": "67",
"safari": "11.1"
},
"corejs": { "version": 3, "proposals": true }
}
],
"@babel/preset-react"
],
"plugins": [
"react-hot-loader/babel",
["@babel/plugin-proposal-decorators", { "legacy": true }],
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-modules-commonjs"
]
}
包含在app.js中
import 'core-js/stable';
import 'regenerator-runtime/runtime';
进行了这些更改之后,polyfill似乎无法正常工作。