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

Function hotEventsPlugin

playground/hmr-ssr/__tests__/hmr-ssr.spec.ts:57–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55
56 beforeAll(async () => {
57 function hotEventsPlugin(): Plugin {
58 return {
59 name: 'hot-events',
60 configureServer(server) {
61 server.environments.ssr.hot.on(
62 'vite:client:connect',
63 () => hotEventCounts.connect++,
64 )
65 server.environments.ssr.hot.on(
66 'vite:client:disconnect',
67 () => hotEventCounts.disconnect++,
68 )
69 },
70 }
71 }
72
73 await setupModuleRunner('/hmr.ts', { plugins: [hotEventsPlugin()] })
74 })

Callers 1

hmr-ssr.spec.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected