prismicio / gatsby-source-graphql-universal

Plugin for connecting arbitrary GraphQL APIs to Gatsby GraphQL with client side execution
2 stars 6 forks source link

fix: reactRuntime is not defined #12

Closed wardpeet closed 4 years ago

wardpeet commented 4 years ago

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

MarcMcIntosh commented 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?

wardpeet commented 4 years ago

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

MarcMcIntosh commented 4 years ago

note you put the changes in to the dist directory :/

MarcMcIntosh commented 4 years ago

I'll fix that :)