developit / developit/microbundle

why esmodule set to false?

オープン
#531 コメント 10 件 リアクション 1 件 担当者 0 名 GitHub で見る
discussion
主要言語
JavaScript
スター
8.1k
フォーク
358
PR マージ指標
30日以内にマージされた PR はありません

説明

```
export const a = 10;
export const b = 10;
```
will generates following in microbundle, which missing `__esModule` flag
1.
```
// lib1.js
exports.a=10,exports.b=10;
//# sourceMappingURL=index.js.map
```
while using rollup generates the folloing code,which seems more accurate
2.
```
// lib2.js
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const a = 10;
const b = 10;

exports.a = a;
exports.b = b;
```
which both works fine in the following
```
const { a,b } =require('lib')
console.log(a,b);
```
but behaves differently in the following code
```
import lib1 from "./lib1";
import lib2 from "./lib2";

console.log("lib1:", lib1); // lib1: { a:1,b:2}
console.log('lib2:',lib2); // lib2: undefiend
```
which lib2 seems more accurate

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。