Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Latest release of Gatsby@2.0.0-rc.9 seems to ignore custom .babelrc #7868

Closed
Calderis opened this issue Sep 4, 2018 · 2 comments
Closed
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting.

Comments

@Calderis
Copy link
Contributor

Calderis commented Sep 4, 2018

Description

In order to accept decorator (@things) babel require plugin @babel/plugin-proposal-decorators so I create my own .babelrc file based on Gatsby's doc.
But, latest release of Gatsby next seems to ignore custom .babelrc file.

Steps to reproduce

By updating to the latest release with "gatsby": "next" in package.json, it fails on each compilation . But by specifying "gatsby": "2.0.0-rc.8" it works back.

custom .babelrc I use

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "loose": true,
        "modules": false,
        "useBuiltIns": "usage",
        "shippedProposals": true,
        "targets": {
          "browsers": [">0.25%", "not dead"],
        },
      },
    ],
    [
      "@babel/preset-react",
      {
        "useBuiltIns": true,
        "pragma": "React.createElement",
      },
    ],
  ],
  "plugins": [
    "babel-plugin-macros",
    ["@babel/plugin-proposal-decorators", { "legacy": true }],
    ["@babel/plugin-proposal-class-properties", { "loose": true }],
    ["@babel/plugin-transform-runtime", { "helpers": true, "regenerator": true }],
    "@babel/plugin-syntax-dynamic-import"
  ],
}

Expected result

Custom .babelrc file seems to be taken into account in version lower than 2.0.0-rc.9.

Actual result

On Gatsby 2.0.0-rc.9, custom .babelrc is ignored. You can still specify rules in custom webpack configuration.

Environment

  
  System:
    OS: macOS High Sierra 10.13.6
    CPU: x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 8.9.0 - ~/.nvm/versions/node/v8.9.0/bin/node
    Yarn: 1.7.0 - /usr/local/bin/yarn
    npm: 5.5.1 - ~/.nvm/versions/node/v8.9.0/bin/npm
  Browsers:
    Chrome: 68.0.3440.106
    Firefox: 61.0.1
    Safari: 11.1.2
  npmPackages:
    gatsby: next => 2.0.0-rc.9 
    gatsby-link: next => 2.0.0-rc.2 
    gatsby-plugin-create-client-paths: next => 2.0.0-rc.1 
    gatsby-plugin-google-analytics: next => 2.0.0-rc.1 
    gatsby-plugin-meta-redirect: ^1.0.4 => 1.1.0 
    gatsby-plugin-postcss-sass: next => 1.0.0-beta.6 
    gatsby-plugin-react-helmet: next => 3.0.0-rc.1 
    gatsby-plugin-sass: next => 2.0.0-rc.1 
    gatsby-remark-copy-linked-files: next => 2.0.0-rc.1 
    gatsby-source-filesystem: next => 2.0.1-rc.1 
    gatsby-transformer-json: next => 2.1.1-rc.1 

@DSchau
Copy link
Contributor

DSchau commented Sep 4, 2018

@Calderis thanks for the thorough reproduction steps. Would you be able to create a repo demonstrating the issue so that we can take a look and debug?

Thank you!

@merelinguist merelinguist added status: needs more info Needs triaging and reproducible examples or more information to be resolved status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. and removed status: needs more info Needs triaging and reproducible examples or more information to be resolved labels Sep 4, 2018
@DSchau
Copy link
Contributor

DSchau commented Sep 5, 2018

Actually, ignore the above 😅

Looks like the PR @pieh referenced is the ticket. Once that's (#7865) merged, this should continue to work like you'd expect.

Thanks!

@Calderis Calderis closed this as completed Sep 5, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting.
Projects
None yet
Development

No branches or pull requests

3 participants