这个东西需要第二级, babel-preset-stage-2,然后再presets里引入stage-2的设置,再plugins离引入对应的插件
{
"presets": ["es2015", "react", "stage-2", "stage-3"],
"plugins": [
"transform-runtime",
"transform-strict-mode",
"transform-es2015-modules-commonjs",
"transform-es2015-spread",
"transform-es2015-destructuring",
"transform-es2015-parameters",
"syntax-async-functions",
"transform-async-to-generator",
"syntax-export-extensions",
"transform-es2015-spread"
]
}
时间: 2024-10-11 14:18:39