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
@babel/preset-env conflicts with @babel/plugin-transform-runtime when using core-js@3 #10271
Comments
Hey @awthwathje! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite. |
I'm pretty sure clarification of this shouldn't take much time, but will help community tremendously. @JLHwung, @nicolo-ribaudo, can you guys maybe check this quickly and respond please? |
Note that with #10008 (I'm working on it right now) you will be also able to use |
@nicolo-ribaudo thanks a lot for your efforts to explain! This should be definitely added to the docs and be easily searchable to prevent further questions like this. Ah, wait... There is already a PR for this. |
Bug Report
Current Behavior
@babel/preset-env
can't be used alongside@babel/plugin-transform-runtime
for polyfilling. Or maybe it can, but no idea how.Expected behavior/code
@babel/preset-env
and@babel/plugin-transform-runtime
work nicely together. Or the opposite should be documented.Babel Configuration (.babelrc, package.json, cli command)
.browserslistrc
Environment
Possible Solution
Make it clear how
@babel/plugin-transform-runtime
and@babel/preset-env
interfere with each other when usingcore-js@3
.Additional context/Screenshots
Hello. This is a follow-up of a vercel/next.js#8104 issue suggested by @Timer.
I've struggled to make my Next.js project to work nicely in IE 11. I wanted to use
@babel/preset-env
andcore-js@3
for polyfilling the missing ES features, but seems like@babel/plugin-transform-runtime
also does perform some polyfilling/transformation, even when provided withcorejs: false
option.One problematic feature is
es.object.assign
. If@babel/plugin-transform-runtime
is enabled,@babel/preset-env
will never try to polyfill it, even if it's directly imported fromcore-js
in the code.Can you please explain if both
@babel/preset-env
and@babel/plugin-transform-runtime
could/should be used together? The documentation is scarce and it's all very confusing at this moment.The text was updated successfully, but these errors were encountered: