Skip to content

Commit bed276b

Browse files
committed
fix: re-scan routes when file is meant to be hot-reloaded but not part of imports tree
1 parent 0280afc commit bed276b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/dev_server.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,11 @@ export class DevServer {
531531
this.#handleFileChange(relativePath, absolutePath, 'add')
532532
})
533533
this.#hooks.add('fileChanged', (relativePath, absolutePath, info) => {
534-
if (info.hotReloaded) {
534+
/**
535+
* Rescan routes when the file is hot-reloaded or when the file is
536+
* not part of the imports tree, but meant to be hot-reloaded
537+
*/
538+
if (info.hotReloaded || (!info.hotReloaded && !info.fullReload)) {
535539
this.#reScanRoutes(absolutePath)
536540
}
537541
this.#handleFileChange(relativePath, absolutePath, 'update', info)

0 commit comments

Comments
 (0)