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

Function waitForWatcher

playground/hmr-ssr/__tests__/hmr-ssr.spec.ts:1090–1101  ·  view source on GitHub ↗
(server: ViteDevServer, watched: string)

Source from the content-addressed store, hash-verified

1088}
1089
1090function waitForWatcher(server: ViteDevServer, watched: string) {
1091 return new Promise<void>((resolve) => {
1092 function checkWatched() {
1093 if (isWatched(server, watched)) {
1094 resolve()
1095 } else {
1096 setTimeout(checkWatched, 20)
1097 }
1098 }
1099 checkWatched()
1100 })
1101}
1102
1103async function setupModuleRunner(
1104 entrypoint: string,

Callers 1

setupModuleRunnerFunction · 0.70

Calls 1

checkWatchedFunction · 0.85

Tested by

no test coverage detected