Skip to content

Commit

Permalink
fix: vite build now works with broken symlink in public
Browse files Browse the repository at this point in the history
  • Loading branch information
crutchcorn committed Nov 6, 2024
1 parent a51c254 commit 5de6850
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/vite/src/node/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,10 @@ export function copyDir(srcDir: string, destDir: string): void {
continue
}
const destFile = path.resolve(destDir, file)
// This may occur if the source directory is a symlink that points to a non-existent directory
if (!fs.existsSync(destFile)) {
return
}
const stat = fs.statSync(srcFile)
if (stat.isDirectory()) {
copyDir(srcFile, destFile)
Expand Down

0 comments on commit 5de6850

Please sign in to comment.