-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(gatsby): Add option to emit TS types during build #36405
Conversation
@@ -419,6 +420,42 @@ module.exports = async function build( | |||
await waitMaterializePageMode | |||
const waitWorkerPoolEnd = Promise.all(workerPool.end()) | |||
|
|||
// create scope so we don't leak state object | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The position of this is quite arbitrary (at the very end of the build). Any reason to not keep it there?
if (state.config.graphqlTypegen) { | ||
telemetry.trackFeatureIsUsed(`GraphQLTypegen`) | ||
writeGraphQLConfig(program) | ||
// This is only run during `gatsby develop` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is correcting the implementation to actually do what the comment said (this file is not needed during gatsby build)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will defer merge until name is decided. Code looks good though!
Description
The request to also have
src/gatsby-types.d.ts
duringgatsby build
has come up more and more in #35420, so this is adding an option to generate this file duringgatsby build
.I'm totally open to a better name than
gatsbyBuild
!Documentation
Docs were changed