Closed wardpeet closed 4 years ago
HI @wardpeet Thanks for the PR, I fully agree over-riding gatsby internals has created a lot of issues as we need to track changes to the original files.
Adding a custom babel-preset to gatsby sounds like a good idea, is there documentation for it?
This is the only documentation I can give you https://www.gatsbyjs.com/docs/node-apis/#onCreateBabelConfig. This is the lifecycle where you can add babel plugins/presets from a plugin point of view.
For reference: https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-emotion/src/gatsby-node.js
note you put the changes in to the dist directory :/
I'll fix that :)
Some gatsby users are reporting that they get an error reactRuntime is not defined. I would suggest not overriding our custom-babel-loader, instead create a babel-preset yourself.
Fixes: https://github.com/gatsbyjs/gatsby/issues/26736 Fixes: #13