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

Function action

packages/vite/src/node/cli.ts:270–288  ·  view source on GitHub ↗
(server)

Source from the content-addressed store, hash-verified

268 key: 'p',
269 description: 'start/stop the profiler',
270 async action(server) {
271 if (profileSession) {
272 await stopProfiler(server.config.logger.info)
273 } else {
274 const inspector = await import('node:inspector').then(
275 (r) => r.default,
276 )
277 await new Promise<void>((res) => {
278 profileSession = new inspector.Session()
279 profileSession.connect()
280 profileSession.post('Profiler.enable', () => {
281 profileSession!.post('Profiler.start', () => {
282 server.config.logger.info('Profiler started')
283 res()
284 })
285 })
286 })
287 }
288 },
289 })
290 }
291 server.bindCLIShortcuts({ print: true, customShortcuts })

Callers

nothing calls this directly

Calls 3

stopProfilerFunction · 0.85
connectMethod · 0.65
infoMethod · 0.65

Tested by

no test coverage detected