We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
fsp.rm
1 parent e2658ad commit b05c405Copy full SHA for b05c405
packages/vite/src/node/optimizer/index.ts
@@ -504,9 +504,12 @@ export function runOptimizeDeps(
504
// No need to wait, we can clean up in the background because temp folders
505
// are unique per run
506
debug?.(colors.green(`removing cache dir ${processingCacheDir}`))
507
- fsp.rm(processingCacheDir, { recursive: true, force: true }).catch(() => {
+ 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) {
511
// Ignore errors
- })
512
+ }
513
}
514
515
0 commit comments