New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Building @babel/standalone fails on commonjs@15 #557
Comments
Would it be possible to boil this problem down to have a reproduction that only contains few files and as few plugins as possible and directly calls Rollup? |
@lukastaegert Sorry for the late reply. Here is a reproduction repo: https://github.com/JLHwung/rollup-plugin-issue-557 It bails when a babel option |
Did you try version 15.1.0 of the commonjs plugin? |
@lukastaegert The reproduction repo uses 15.1.0. |
Hey folks. This issue hasn't received any traction for 60 days, so we're going to close this for housekeeping. If this is still an ongoing issue, please do consider contributing a Pull Request to resolve it. Further discussion is always welcome even with the issue closed. If anything actionable is posted in the comments, we'll consider reopening it. ⓘ |
Rollup Config: https://github.com/JLHwung/babel/blob/95dc47882afbe98064f90420108f69b35b070f4a/Gulpfile.js#L123-L164
Expected Behavior
Build all babel artifacts.
Actual Behavior
throws
See https://github.com/JLHwung/babel/runs/1033102860#step:6:573 for the error logs.
Additional Information
I believe it is an integration issue between
@rollup/plugin-babel
and@rollup/plugin-commonjs
: Theplugin-babel
serves a virtual filerollupPluginBabelHelpers.js
via theload
hook. It is am ESM moudle generated from@babel/core
. So I guess what happens here is the babel helper is added to thechalk/templates
(because of for-of helpers) but for some reason transformed asrequire
when Rollup is processing. On reading https://github.com/rollup/plugins/tree/master/packages/commonjs#esmexternals, it seems that I should specifyesmExternals
, so I tried add tocommonjs
the following options.But the build still fails. Even in the end
esmExternals
works for this virtual file, it feel like a hack and I hope it can be processed by@rollup/plugin-babel
.Another issue may be related: I tried downgraded
commonjs@14
but our standalone test fails: https://github.com/babel/babel/runs/1033085554#step:10:128 I haven't investigate yet.As a workaround we are pinning
commonjs
to 13: babel/babel#12010The text was updated successfully, but these errors were encountered: