GraphQL Typegen should write gatsby-types.d.ts
only when it is changed
#38051
Unanswered
kota65535
asked this question in
Ideas / Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This Ideas / Feature Request originated from #37983 and #38045.
I want to perform TypeScript type-checking on every Fast Refresh.
This can be done by adding a custom configuration of fork-ts-checker-webpack-plugin in onCreateWebpackConfig.
But when I enabled GraphQL Typegen with this configuration, I'm stuck in an infinite loop of Fast Refresh.
This is because fork-ts-checker-webpack-plugin adds
gatsby-types.d.ts
tocompilation.fileDependencies
, whose changes are watched by webpack.gatsby-types.d.ts
gatsby-types.d.ts
is re-createdgatsby-types.d.ts
is changed, Fast Refresh runs and thengatsby-types.d.ts
is re-createdgatsby-types.d.ts
is changed, Fast Refresh runs and thengatsby-types.d.ts
is re-createdI think the simple solution to this problem is to write
gatsby-types.d.ts
only when the file is changed.gatsby/packages/gatsby/src/utils/graphql-typegen/ts-codegen.ts
Line 163 in 8c9b0d4
The code change can be as follows:
I would like to make a PR if this idea is OK.
Beta Was this translation helpful? Give feedback.
All reactions