Если узел 8.10 поддерживает async / await, почему babel преобразует асинхронные функции в генераторы?
babel переводит:
const foo = async () => {
const b = await bar()
console.log(b)
}
в:
const foo = (() => {
var _ref2 = (0, _asyncToGenerator3.default)(function* () {
const b = yield bar();
console.log(b);
});
return function foo() {
return _ref2.apply(this, arguments);
};
})()
thisмой конфиг babel:
"babel": {
"plugins": [
"source-map-support",
"transform-runtime"
],
"presets": [
[
"env",
{
"targets": {
"node": "8.10"
}
}
],
"stage-3"
]
}