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();