developit / developit/microbundle

Maybe should compile `node_modules` with babel when use inline dependencies

未关闭
#936 7 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
8.1k
派生
358
PR 合并指标
30 天内没有已合并 PR

描述

Now microbundle is use `exclude: 'node_modules/**'` to create babel config, I think it's reasonable when not inline dependencies.
But if use inline dependencies... this options maybe is weird?

```typescript
// foo/bar.js (in node_modules)
module.exports = {a: ()=>console.log('1')}
```

```typescript
// My module
import abc from 'foo/bar.js';
window.de = abc

export const b = () => {
console.log('2')
}
```

Then add `foo` module to `devDependencies`.

Result:
```typescript
window.de={a:()=>console.log("1")};var o=function(){console.log('2')};export{o as b};
```
If i use inline dependencies mean **i hope it's part of mine module**, my modules arrow function has compile (it's right) but `foo` modules has nothing change.

Maybe should not set `exclude: 'node_modules/**'` when use inline dependencies?

贡献指南

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

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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