From 30126f716ea55a242ebd88be70795adbc72cfd74 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Thu, 4 Dec 2025 11:22:04 +0000 Subject: [PATCH] feat(TypedServer): Enhance file watching with glob pattern for recursive directory matching --- ts/classes.typedserver.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ts/classes.typedserver.ts b/ts/classes.typedserver.ts index c8e8ff8..b3ac69e 100644 --- a/ts/classes.typedserver.ts +++ b/ts/classes.typedserver.ts @@ -271,7 +271,11 @@ export class TypedServer { // Setup file watching if (this.options.watch && this.options.serveDir) { try { - this.smartwatchInstance = new plugins.smartwatch.Smartwatch([this.options.serveDir]); + // Use glob pattern to match all files recursively in serveDir + const watchGlob = this.options.serveDir.endsWith('/') + ? `${this.options.serveDir}**/*` + : `${this.options.serveDir}/**/*`; + this.smartwatchInstance = new plugins.smartwatch.Smartwatch([watchGlob]); await this.smartwatchInstance.start(); (await this.smartwatchInstance.getObservableFor('change')).subscribe(async () => { await this.createServeDirHash();