Skip to content

Commit

Permalink
fix: fixed ENOENT: no such file or directory
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromehan committed Dec 28, 2022
1 parent 13ac37d commit fd26de9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vite/src/node/utils.ts
Expand Up @@ -606,7 +606,9 @@ export function copyDir(srcDir: string, destDir: string): void {
export const removeDir = isWindows
? promisify(gracefulRemoveDir)
: function removeDirSync(dir: string) {
fs.rmSync(dir, { recursive: true, force: true })
if (fs.existsSync(dir)) {
fs.rmSync(dir, { recursive: true, force: true })
}
}
export const renameDir = isWindows ? promisify(gracefulRename) : fs.renameSync

Expand Down

0 comments on commit fd26de9

Please sign in to comment.