Open make-github-pseudonymous-again opened 3 years ago
Hi @aureooms!
Sorry to hear you're running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you're able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it.
If you're up for it, we'd very much appreciate if you could provide a minimal reproduction and we'll be able to take another look.
Thanks for trying out microbundle
I cannot promise to find time to produce a minimal failing example. Currently, I workaround the problem by either disabling mangling, or marking all named imports that match the regex
as reserved
.
For the UMD build it's worse: since exports are created with function(exports) { ... ; exports._fn = x; }
even internal exports names that match the regex
get mangled, in addition to the external import names. I guess you have to be really picky with what you want to mangle for it to be useful.
I have some code that imports a named export of a dependency as follows:
With mangle configured with
"regex": "^_[^_]"
, the default build (index.js
) transpiles this to:Disabling mangling works as expected:
There is a similar problem with the umd build.
Any way around this?