CodingZeal / create-react-app

Create React apps with no build configuration.
MIT License
2 stars 2 forks source link

Exlude `graphql` and `gql` from fileTransform pattern #29

Closed bmatto closed 6 years ago

bmatto commented 6 years ago

In packages/react-scripts/scripts/utils/createJestConfig.js the transform config block contains a pattern to use fileTransform. The regex for that block of code is a catch all for extensions not referenced. Though graphql and gql have there own pattern which intends to use the jest-transform-graphql module, that pattern is not used because of the aforementioned catch all. This PR simply adds those extensions to allow them to be caught by the intended loader.

I should also note that in create-react-app on the next branch, there is a commit which does something very similar to the zeal block for graphql files. However in the mean time, graphql loading for jest is not working, in that a graphql file loaded in jest is converted to a stringified name via the fileTransform

randycoulman commented 6 years ago

Good catch, thanks! Change looks good to me.