We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3748acb commit 1b043f9Copy full SHA for 1b043f9
packages/vite/src/node/utils.ts
@@ -606,7 +606,12 @@ export function copyDir(srcDir: string, destDir: string): void {
606
export const removeDir = isWindows
607
? promisify(gracefulRemoveDir)
608
: function removeDirSync(dir: string) {
609
- fs.rmSync(dir, { recursive: true, force: true })
+ // when removing `.vite/deps`, if it doesn't exist, nodejs may also remove
610
+ // other directories within `.vite/`, including `.vite/deps_temp` (bug).
611
+ // workaround by checking for directory existence before removing for now.
612
+ if (fs.existsSync(dir)) {
613
+ fs.rmSync(dir, { recursive: true, force: true })
614
+ }
615
}
616
export const renameDir = isWindows ? promisify(gracefulRename) : fs.renameSync
617
0 commit comments