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.config.js not picked up since 2.13.30 (regression) #16134
Comments
I tested a few different Gatsby versions to see when the problem was introduced:
So looks like something in 2.13.30 caused this issue. |
/cc @wardpeet Did this stop working only for |
It does seem like gatsby/packages/gatsby/src/utils/webpack-utils.js Lines 327 to 331 in e348ae6
configFile: false part ) is most likely reason for this.
@wardpeet Was this setting explicitly needed? |
I disabled it because people should use .babelrc files instead. babel.config.js is used for library owners or in the root but shouldn't be used on a project level. https://babeljs.io/docs/en/config-files#project-wide-configuration |
Let's be clear: babel.config.js is referred to in the docs as a "project-wide config". It is definitely meant to be used at the project level. I haven't seen anything saying babel.config.js is for library owners only. Can you provide a source @wardpeet? |
|
Description
Since updating Gatsby to
2.13.30
(or newer), I can no longer use my own custombabel.config.js
.babel.config.js
is the new, better way to configure Babel. See Babel config files docs.Steps to reproduce
I've created a minimal repro here: https://github.com/ahfarmer/gatsby-babel-config-issue
To create the repro I just ran
gatsby new
, then addedbabel.config.js
and deleted some unnecessary files.Here's how you can reproduce easily:
Note that the console.log line that I have placed in
babel.config.js
does NOT print out. There are other ways you could show thatbabel.config.js
is not being considered, but I think this is the easiest one.Expected result
We should see this line printed to the console:
"👍 babel.config.js is being used"
Actual result
babel.config.js
is not used for some reason. The code within does not run and the log statement doesn't print out.Workaround
With this older version of Gatsby, you will see that
babel.config.js
is being used.Related Issues
Basically the same issue reported here: birkir/gatsby-source-graphql-universal#3
I opened this issue to show that it is not an issue with
gatsby-source-graphql-universal
, which I am not using.They are reporting that this change caused the issue: #15875
Environment
The text was updated successfully, but these errors were encountered: