developit / developit/microbundle

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

Đang mở
#705 9 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug :bug: has-fix
Ngôn ngữ chính
JavaScript
Star
8.1k
Fork
358
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**[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
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.