perf: call `module.enableCompileCache()`

Co-authored-by: green <green@sapphi.red>
pull/4600/merge
Divyansh Singh 5 months ago
parent e5ab0676a9
commit 70de34c038

@ -1,2 +1,16 @@
#!/usr/bin/env node
// @ts-check
import module from 'node:module'
// https://github.com/vitejs/vite/blob/6c8a5a27e645a182f5b03a4ed6aa726eab85993f/packages/vite/bin/vite.js#L48-L63
try {
module.enableCompileCache?.()
setTimeout(() => {
try {
module.flushCompileCache?.()
} catch {}
}, 10 * 1000).unref()
} catch {}
import('../dist/node/cli.js')

Loading…
Cancel
Save