Babel helpers are bundled into the output file.
zhangshme opened this issue · 8 comments
If I add @babel/runtime-corejs3
as a dependency. Babel helpers are bundled in, without any import
.
But when I remove @babel/runtime-corejs3
from the dependencies, output file looks like this
Same config, different outputs. I tried to add @babel/runtime-corejs3
to the rollup external
field, but had no difference.
Could someone explain this? Thanks!
Same config, different outputs.
I suspect that you could see some warnings about rollup's inability to resolve @babel/runtime-corejs3
when you hadn't it installed.
I tried to add @babel/runtime-corejs3 to the rollup external field, but had no difference.
That's because those imports are using "deep paths". With @babel/runtime-corejs3
added to external you have only added literally @babel/runtime-corejs3
to externals, not its subdirectories etc. I personally deal with this problem like this.
Also - runtimeHelpers
& externalHelpers
arent supposed to be used together. You should use only one of them.
Appreciate to your reply.
I suspect that you could see some warnings about rollup's inability to resolve @babel/runtime-corejs3 when you hadn't it installed.
Yes, there are some warnings actually. So, can I say that missing the corejs3
dependency cause the output difference?
I personally deal with this problem like this.
Also - runtimeHelpers & externalHelpers arent supposed to be used together.
Thanks. I've updated my rollup config like this, and worked as I expected.
I dont actually see where is used before its value is assigned. To get more help regarding this you'd have to share a repository with the issue reproduced in it - without this it's guesswork.
Very appreciate to your patience. I've created a repo. Hope this will not take you too much time. Thanks!
The problem for sure is not in this plugin because it's sole responsibility is to transform single files with Babel. The issue ain't that easy to track down BUT my best guess is that rollup-plugin-commonjs
fails to convert core-js properly (or rather it doesn't handle circular dependencies well, as core-js seems to have a TON of them). I would suggest reporting it over there.
Got it. Thanks a lot!