MCPcopy
hub / github.com/vitejs/vite / cleanUp

Function cleanUp

packages/vite/src/node/optimizer/index.ts:559–574  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

557 let cleaned = false
558 let committed = false
559 const cleanUp = () => {
560 // If commit was already called, ignore the clean up even if a cancel was requested
561 // This minimizes the chances of leaving the deps cache in a corrupted state
562 if (!cleaned && !committed) {
563 cleaned = true
564 // No need to wait, we can clean up in the background because temp folders
565 // are unique per run
566 debug?.(colors.green(`removing cache dir ${processingCacheDir}`))
567 try {
568 // When exiting the process, `fsp.rm` may not take effect, so we use `fs.rmSync`
569 fs.rmSync(processingCacheDir, { recursive: true, force: true })
570 } catch {
571 // Ignore errors
572 }
573 }
574 }
575
576 const successfulResult: DepOptimizationResult = {
577 metadata,

Callers 2

runOptimizeDepsFunction · 0.85
cancelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected