(startDir: string)
| 244 | } |
| 245 | |
| 246 | function findNearestNodeModules(startDir: string): string | null { |
| 247 | let current = resolve(startDir); |
| 248 | while (true) { |
| 249 | const candidate = join(current, "node_modules"); |
| 250 | try { |
| 251 | if (statSync(candidate).isDirectory()) return candidate; |
| 252 | } catch { |
| 253 | // Keep walking up. |
| 254 | } |
| 255 | const parent = dirname(current); |
| 256 | if (parent === current) return null; |
| 257 | current = parent; |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | function createReloadAdapter<S>(opts: HotStateReloadOptions<S>): Readonly<{ |
| 262 | entryModule: string | URL; |
no test coverage detected