From a99e18248ef3940ce236ddaf631526cc229ec0cb Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Mon, 20 Sep 2021 16:42:06 +0100 Subject: [PATCH] fix: ensure cache/json exists --- plugin/src/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugin/src/index.ts b/plugin/src/index.ts index 1a98d58e..9025a473 100644 --- a/plugin/src/index.ts +++ b/plugin/src/index.ts @@ -42,6 +42,10 @@ export async function onPreBuild({ await checkEnvironment({ utils }) } await restoreCache({ utils, publish: PUBLISH_DIR }) + const CACHE_DIR = normalizedCacheDir(PUBLISH_DIR) + + // Work around Gatsby bug https://github.com/gatsbyjs/gatsby/issues/33262 + await fs.ensureDir(join(CACHE_DIR, 'json')) checkGatsbyConfig({ utils, netlifyConfig }) }