Skip to content

Commit 6ca4c20

Browse files
committed
fix(#672): recursively watch for changes to the contracts folder
1 parent 7ba1db3 commit 6ca4c20

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

components/hotReloadService.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ import { FileChangeInfo, watch } from "fs/promises"
2323
*
2424
* @param target The file or folder name to watch.
2525
* @param callback What to do when the hot updater is triggered.
26+
* @param recursive Whether to watch for changes to subdirectories if the target is a folder.
2627
*/
2728
export async function setupHotListener(
2829
target: string,
2930
callback: (event: FileChangeInfo<string>) => void,
31+
recursive: boolean = false,
3032
): Promise<void> {
3133
try {
32-
const watcher = watch(target, {})
34+
const watcher = watch(target, { recursive })
3335

3436
for await (const event of watcher) {
3537
callback(event)

components/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ export async function startServer(options: {
544544
"contracts",
545545
)
546546
})
547-
})
547+
}, true)
548548
}
549549

550550
// once contracts directory is present, we are clear to boot

0 commit comments

Comments
 (0)