From 037de565a819ddcfac9664614e03f3680f22b361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Wed, 13 May 2020 11:21:09 +0200 Subject: [PATCH] fix(gatsby): wait for app-data.json file writing (#22099) * Cleanup app-data * revert stylistic changes Co-authored-by: Michal Piechowiak --- packages/gatsby/src/utils/app-data.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/gatsby/src/utils/app-data.ts b/packages/gatsby/src/utils/app-data.ts index 311d84cf8bc8f..0b3f0b9610ef0 100644 --- a/packages/gatsby/src/utils/app-data.ts +++ b/packages/gatsby/src/utils/app-data.ts @@ -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 => 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))