Skip to content
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

Merged
merged 3 commits into from
Jul 30, 2019

Conversation

wardpeet
Copy link
Contributor

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

@wardpeet wardpeet requested a review from a team as a code owner July 30, 2019 07:44
m-allanson
m-allanson previously approved these changes Jul 30, 2019
Copy link
Contributor

@m-allanson m-allanson left a 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

@wardpeet
Copy link
Contributor Author

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

Copy link
Contributor

@m-allanson m-allanson left a 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!

@m-allanson m-allanson merged commit d72b6d9 into gatsbyjs:master Jul 30, 2019
@wardpeet wardpeet deleted the revert/custom-babelrc branch July 30, 2019 09:45
@andrewagain
Copy link
Contributor

andrewagain commented Jul 30, 2019

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?

@m-allanson
Copy link
Contributor

Hey @ahfarmer 👋 we reached the same conclusion as you in this PR - the ability to use babel.config.js has been added back in and is available in gatsby@2.13.44

@wardpeet
Copy link
Contributor Author

wardpeet commented Aug 1, 2019

@ahfarmer #16205 (comment)

I've updated my view on babel.config.js

johno pushed a commit to johno/gatsby that referenced this pull request Aug 2, 2019
* fix(gatsby): enable babel.config.js once again

* fix snapshot

* remove comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

babel.config.js not picked up since 2.13.30 (regression)
3 participants