Skip to content

Commit

Permalink
fix: make sure we emit ENGINES_READY after build-ssr (#33180)
Browse files Browse the repository at this point in the history
  • Loading branch information
pieh authored Sep 14, 2021
1 parent 4712acc commit 3c1f285
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions packages/gatsby/src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,19 +262,6 @@ module.exports = async function build(program: IBuildArgs): Promise<void> {
}
waitForCompilerCloseBuildHtml = result.waitForCompilerClose

if (_CFLAGS_.GATSBY_MAJOR === `4` && shouldGenerateEngines()) {
Promise.all(engineBundlingPromises).then(() => {
if (process.send) {
process.send({
type: `LOG_ACTION`,
action: {
type: `ENGINES_READY`,
},
})
}
})
}

// TODO Move to page-renderer
if (_CFLAGS_.GATSBY_MAJOR === `4`) {
const routesWebpackConfig = await webpackConfig(
Expand Down Expand Up @@ -303,6 +290,19 @@ module.exports = async function build(program: IBuildArgs): Promise<void> {
})
})
}

if (_CFLAGS_.GATSBY_MAJOR === `4` && shouldGenerateEngines()) {
Promise.all(engineBundlingPromises).then(() => {
if (process.send) {
process.send({
type: `LOG_ACTION`,
action: {
type: `ENGINES_READY`,
},
})
}
})
}
} catch (err) {
buildActivityTimer.panic(structureWebpackErrors(Stage.BuildHTML, err))
} finally {
Expand Down

0 comments on commit 3c1f285

Please sign in to comment.