feat(TypedServer): Enhance file watching with glob pattern for recursive directory matching
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user