developit / developit/microbundle

Why re-export overriding does not work if I use microbundle ?

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

説明

Hi guys,

I have run into some really weird situation here. Here is some [demo code](https://github.com/qjnz/re-export-override-demo) here, which does not use `microbundle` in that project.

What I am trying to do is like the following:
```js
import { theFunction } from './myOverrides'

export * from 'some-library'
export { theFunction } // theFunction here should override the theFunction from the `some-library`
```

However, from the emitted umd.js or common.js file that I got from `microbundle`, the `theFunction` does not get override since I can see that the legacy javascript code I got from the output is doing something like below

```js
Object.keys(r).forEach(function (e) {
'default' !== e &&
Object.defineProperty(exports, e, {
enumerable: !0,
get: function () {
return r[e]
},
})
}),
```

which the latter export `export { theFunction }` does not override it.

My question is that if somehow the `microbundle` does some magic here about `export * from 'some-library'`.

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

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

評価

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

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

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