Content-Length: 277188 | pFad | https://togithub.com/vitejs/vite/commit/b05c405

297 fix: `fsp.rm` removing files does not take effect (#16032) · vitejs/vite@b05c405 · GitHub
Skip to content

Commit b05c405

Browse files
authored
fix: fsp.rm removing files does not take effect (#16032)
1 parent e2658ad commit b05c405

File tree

1 file changed

+5
-2
lines changed
  • packages/vite/src/node/optimizer

1 file changed

+5
-2
lines changed

packages/vite/src/node/optimizer/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,12 @@ export function runOptimizeDeps(
504504
// No need to wait, we can clean up in the background because temp folders
505505
// are unique per run
506506
debug?.(colors.green(`removing cache dir ${processingCacheDir}`))
507-
fsp.rm(processingCacheDir, { recursive: true, force: true }).catch(() => {
507+
try {
508+
// When exiting the process, `fsp.rm` may not take effect, so we use `fs.rmSync`
509+
fs.rmSync(processingCacheDir, { recursive: true, force: true })
510+
} catch (error) {
508511
// Ignore errors
509-
})
512+
}
510513
}
511514
}
512515

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://togithub.com/vitejs/vite/commit/b05c405

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy