Skip to content

Commit

Permalink
fix(gatsby): wait for app-data.json file writing (gatsbyjs#22099)
Browse files Browse the repository at this point in the history
* Cleanup app-data

* revert stylistic changes

Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com>
  • Loading branch information
MichaelDeBoey and pieh committed May 13, 2020
1 parent c178646 commit 037de56
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/gatsby/src/utils/app-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ import path from "path"

const APP_DATA_JSON = `app-data.json`

export const write = (publicDir: string, hash: string): void => {
export const write = (publicDir: string, hash: string): Promise<void> =>
fs.outputJson(path.join(publicDir, `page-data`, APP_DATA_JSON), {
webpackCompilationHash: hash,
})
}

export const exists = (publicDir: string): boolean =>
fs.pathExistsSync(path.join(publicDir, `page-data`, APP_DATA_JSON))

0 comments on commit 037de56

Please sign in to comment.