我试图阻止 Babel 使用以下方法转换箭头函数
.babelrc
:
{
"presets": [
[
"env",
{
"exclude": [
"transform-regenerator",
"transform-async-to-generator",
"transform-arrow-functions"
]
}
],
"react",
"stage-0"
]
}
"transform-arrow-functions"
不会编译并导致错误。但是这里指定了,包含在preset-env中:
https ://github.com/babel/babel/blob/master/packages/babel-preset-env/data/plugin-features.js