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

Function start

packages/vite/bin/vite.js:48–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46}
47
48function start() {
49 try {
50 // eslint-disable-next-line n/no-unsupported-features/node-builtins -- it is supported in Node 22.8.0+ and only called if it exists
51 module.enableCompileCache?.()
52 // flush the cache after 10s because the cache is not flushed until process end
53 // for dev server, the cache is never flushed unless manually flushed because the process.exit is called
54 // also flushing the cache in SIGINT handler seems to cause the process to hang
55 setTimeout(() => {
56 try {
57 // eslint-disable-next-line n/no-unsupported-features/node-builtins -- it is supported in Node 22.12.0+ and only called if it exists
58 module.flushCompileCache?.()
59 } catch {}
60 }, 10 * 1000).unref()
61 } catch {}
62 return import('../dist/node/cli.js')
63}
64
65if (profileIndex > 0) {
66 process.argv.splice(profileIndex, 1)

Callers 1

vite.jsFile · 0.70

Calls 1

unrefMethod · 0.80

Tested by

no test coverage detected