Skip to content

Commit

Permalink
chore(gatsby): Keep page renderer around (#28784)
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthachatterjee authored Dec 29, 2020
1 parent 2058775 commit 5c3931c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/gatsby/src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ interface IBuildArgs extends IProgram {
profile: boolean
graphqlTracing: boolean
openTracingConfigFile: string
keepPageRenderer: boolean
}

module.exports = async function build(program: IBuildArgs): Promise<void> {
Expand Down Expand Up @@ -284,10 +285,12 @@ module.exports = async function build(program: IBuildArgs): Promise<void> {
}
buildHTMLActivityProgress.end()

try {
await deleteRenderer(pageRenderer)
} catch (err) {
// pass through
if (!program.keepPageRenderer) {
try {
await deleteRenderer(pageRenderer)
} catch (err) {
// pass through
}
}

let deletedPageKeys: Array<string> = []
Expand Down

0 comments on commit 5c3931c

Please sign in to comment.