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 <[email protected]>
  • Loading branch information
2 people authored and axe312ger committed Nov 9, 2021
1 parent 32bb195 commit 7fcfe3d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/gatsby/src/commands/build.ts
Original file line number Diff line number Diff line change
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 7fcfe3d

Please sign in to comment.