From c7bad74b886d580959640f378f7b131a261308d5 Mon Sep 17 00:00:00 2001 From: James Brooks <52410024+jabrks@users.noreply.github.com> Date: Tue, 21 Jul 2020 12:37:05 +0100 Subject: [PATCH] fix(gatsby): Support symlinks in static directories (#25894) --- packages/gatsby/src/utils/get-static-dir.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/gatsby/src/utils/get-static-dir.ts b/packages/gatsby/src/utils/get-static-dir.ts index 77b0aedb9470e..96175d2070f8c 100644 --- a/packages/gatsby/src/utils/get-static-dir.ts +++ b/packages/gatsby/src/utils/get-static-dir.ts @@ -27,7 +27,11 @@ export const copyStaticDirs = (): void => { // filter out the static folders that don't exist .filter(themeStaticPath => fs.existsSync(themeStaticPath)) // copy the files for each folder into the user's build - .map(folder => fs.copySync(folder, nodePath.join(process.cwd(), `public`))) + .map(folder => + fs.copySync(folder, nodePath.join(process.cwd(), `public`), { + dereference: true, + }) + ) const staticDir = nodePath.join(process.cwd(), `static`) if (!fs.existsSync(staticDir)) return undefined