-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
fix(gatsby): enable babel.config.js once again #16205
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
I'd love to hear more about:
It's not encouraged to use it the way people are using it for Gatsby
Oh gatsby is always used as a "root" project and I don't see an immediate use case to programmatically add/remove config to babel for a gatsby project. Configs are mostly static and might change depending on build (production) or develop (development). If you want to share configs between projects you can use a babel.config.js in your root. For themes, this might be a good solution 🤔. https://babeljs.io/docs/en/configuration#what-s-your-use-case Let me revert the comment as it might not be the best idea to disable it. Thanks @m-allanson for letting me re-iterating |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you for the update!
I've got Gatsby as one of the projects in my repo. I share code between two Gatsby projects and a React Native project. I use babel.config.js to ensure that code I import has my project Babel rules applied - despite not descending from my Gatsby project root. Please reconsider. Frustrating to see Babel come out with the perfect solution, and then to hear that Gatsby will just turn it off. @wardpeet I've seen you arguing that we shouldn't use this feature but haven't seen any reasons why. Why not simply leave this feature available in all Gatsby versions? What benefit do you gain from disabling it? |
Hey @ahfarmer 👋 we reached the same conclusion as you in this PR - the ability to use |
I've updated my view on babel.config.js |
* fix(gatsby): enable babel.config.js once again * fix snapshot * remove comment
Description
Bring back support for babel.config.js which we should disable in V3 as it's a breaking change for v2. It's not encouraged to use it the way people are using it for gatsby.
Related Issues
Fixes #16134