developit / developit/microbundle

async/await is always transpiled into regenerator even with browserconfig or babelrc

未关闭
#705 9 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug :bug: has-fix
主要语言
JavaScript
星标
8.1k
派生
358
PR 合并指标
30 天内没有已合并 PR

描述

**[Click to see workaround](https://github.com/developit/microbundle/issues/705#issuecomment-675901881)**

### How to reproduce error
Execute this script in an empty directory
```bash
#!/bin/bash

cat > index.js <<< 'export function* yo() { yield 1 }'
cat > package.json <<'EOF'
{
"name": "a",
"devDependencies": {
"microbundle": "0.12.3"
},
"browserslist": [
"last 2 Chrome versions"
]
}
EOF

yarn
yarn microbundle --no-compress
cat dist/a.js
```

### Expected resut
```js
function* yo() {
yield 1;
}

exports.yo = yo;
//# sourceMappingURL=a.js.map
```

### Actual result
```js
var _marked = /*#__PURE__*/regeneratorRuntime.mark(yo);

function yo() {
return regeneratorRuntime.wrap(function yo$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return 1;

case 2:
case "end":
return _context.stop();
}
}, _marked);
}

exports.yo = yo;
//# sourceMappingURL=a.js.map
```

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。