.babelrc 文件
{
"plugins": [
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-transform-runtime"
],
"presets": [
["@babel/preset-env", {
"useBuiltIns": "usage",
"corejs": 3,
"targets": {
// https://jamie.build/last-2-versions
"browsers": ["> 0.25%", "not ie 11", "not op_mini all"]
}
}]
]
}
npm install @babel/plugin-proposal-optional-chaining --save-dev
npm install @babel/plugin-transform-runtime --save-dev
Can't resolve '@babel/runtime/helpers/classCallCheck' 错误
npm i @babel/runtime --save-dev