Skip to content

Commit

Permalink
fix(gatsby): Support symlinks in static directories (#25894)
Browse files Browse the repository at this point in the history
  • Loading branch information
jabrks authored and KyleAMathews committed Jul 29, 2020
1 parent 2d58747 commit c7bad74
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/gatsby/src/utils/get-static-dir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c7bad74

Please sign in to comment.