developit / developit/microbundle
why esmodule set to false?
- 主要语言
- 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
贡献指南
这个仓库没有索引到贡献指南
调研方向
Start by reproducing the two generated CommonJS outputs from the export example and compare how their __esModule markers affect the shown default-import behavior. Read the microbundle and Rollup output configuration involved in CommonJS generation; done means determining whether the difference is intentional and documenting or correcting the behavior with a regression test.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, rollup
- 领域
- build-system
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100