Skip to content

Commit

Permalink
fix(gatsby): restore onPreBuild to being called right after bootstrap…
Browse files Browse the repository at this point in the history
… finishes (#33591)

* fix(gatsby): restore onPreBuild to being called right after bootstrap finishes

Somehow it drifted down in the build where it's supposed to be the first API called after bootstrap finishes https://www.gatsbyjs.com/docs/reference/config-files/gatsby-node/#onPreBuild

* chore: format

Co-authored-by: gatsbybot <mathews.kyle+gatsbybot@gmail.com>
  • Loading branch information
KyleAMathews and gatsbybot committed Oct 19, 2021
1 parent 1cdbab6 commit 4761dc3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/gatsby/src/commands/build.ts
Expand Up @@ -107,6 +107,11 @@ module.exports = async function build(program: IBuildArgs): Promise<void> {
parentSpan: buildSpan,
})

await apiRunnerNode(`onPreBuild`, {
graphql: gatsbyNodeGraphQLFunction,
parentSpan: buildSpan,
})

// writes sync and async require files to disk
// used inside routing "html" + "javascript"
await writeOutRequires({
Expand Down Expand Up @@ -292,11 +297,6 @@ module.exports = async function build(program: IBuildArgs): Promise<void> {
})
}

await apiRunnerNode(`onPreBuild`, {
graphql: gatsbyNodeGraphQLFunction,
parentSpan: buildSpan,
})

// Copy files from the static directory to
// an equivalent static directory within public.
copyStaticDirs()
Expand Down

0 comments on commit 4761dc3

Please sign in to comment.