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
Migrate from core-js@2 to core-js@3 in Babel config #8103
Comments
Thanks for digging into this @awthwathje! We'll try to update the babel configuration soon. |
@Timer great, thanks a lot for the effort. Ping me if you need any help. |
@Timer
I moved from
And as I understood from the topic the following setting does not work:
For me it just does not finish bundling process at all. |
@Carduelis I'm not @Timer, but you are correct: You could use custom Babel config, like I do (it's in the original post), while waiting for the |
Whit "next": "^9.1.3", I get: Updating the deps would fix this warning I guess :) |
We're removing core-js being included in Next.js completely in favor of a separate chunk only loaded in older browsers: #10212 |
@timneutkens thats great news. Currently there is a |
No those 2 are completely separate efforts and do different things. Btw the message shown by npm is very out of context and needlessly pressing. We never had any issues with core-js@2 and I wish we could instruct npm to not show certain messages when installing Next.js 😕 |
@timneutkens could you point out the difference between them? I thought the |
|
@timneutkens when trying to use polyfillsOptimzation it seems I still have to use the react-app-polyfill to get our app to run in IE11. |
@timneutkens thanks for the heads up |
@lifeiscontent a reproduction would be helpful otherwise it's hard to do anything actionable. |
@timneutkens I'll see if I have time to put something together later this week, thanks! |
@timneutkens what is the recommended babel.config.js after this changes? |
@dohomi no babel config? There's only a few reasons to have it. |
@Timer @timneutkens thanks a lot guys, this is super-helpful and now Next.js apps work in IE11 without any additional configuration! Just wanted to mention, that it worked for me only with |
@awthwathje it was not released yet, will be part of 9.3, you can opt-in on stable through:
|
@timneutkens thanks for the clarification, for some reason I thought that the fact that this ticket was closed means that the feature has landed in stable, that is 9.2. My bad. |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Feature request
Is your feature request related to a problem? Please describe.
core-js@3 has been released in March 2019, adding a lot of new features. It's a great time to revamp the Babel config provided by Next.
Describe the solution you'd like
A modern-ish approach to configure Babel.
Describe alternatives you've considered
Got rid of
next/babel
preset in custom Babel config, adding everything by hand.Additional context
So, I had this quite straightforward Babel config (
.babelrc
) for ages:with the following
.browserslistrc
:and eventually I discovered that the app doesn't work in IE 11. I mean, something worked and something didn't. So I started to dig up to make sure every feature which Internet Explorer 11 is missing is polyfilled.
I checked the next/babel preset and figured out that it contains both
@babel/plugin-transform-runtime
plugin and@babel/preset-env
:Here, the polyfilling is being done by the
@babel/plugin-transform-runtime
plugin, using core-js@2. But in the age of Babel ^7.4, it's suggested to use@babel/preset-env
for that, setting itsuseBuiltIns
andcorejs
options.Being unable to use
@babel/preset-env
and disable@babel/plugin-transform-runtime
, I "dissected" the wholenext/babel
preset and reassembled it in custom.babelrc
, excluding some plugins which are irrelevant for my project (like AMP andstyled-jsx
).So I ended up with this:
(Note:
babel.config.js
didn't work for me, so I stayed with the.babelrc
for now)That being said, please consider upgrading the
next/babel
preset to make sure it's using all the latest/greatest stuff.Nice project by the way 🙂.
The text was updated successfully, but these errors were encountered: