Skip to content

Commit 38f24e7

Browse files
committed
refactor: do not kill watcher when http server dies
1 parent 79f51b1 commit 38f24e7

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/BuildWatcher/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,10 @@ export class BuildWatcher {
6565
})
6666

6767
/**
68-
* Close watcher when server dies
68+
* Notify that server has died
6969
*/
7070
httpServer.on('exit', ({ code }) => {
71-
this._logger.stop(`closing watcher. Underlying HTTP server died with "%s code"`, code)
72-
watcher.close()
71+
this._logger.stop(`Underlying HTTP server died with "%s code"`, code)
7372
})
7473

7574
/**

src/Watcher/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,10 @@ export class Watcher {
6464
this.compiler.createHttpServer(config.options.outDir!)
6565

6666
/**
67-
* Close watcher when server dies
67+
* Notify that the http server has died
6868
*/
6969
this.compiler.httpServer.on('exit', ({ code }) => {
70-
this._logger.stop(`closing watcher. Underlying HTTP server died with "%s code"`, code)
71-
watcher.chokidar.close()
70+
this._logger.warn(`Underlying HTTP server died with "%s code"`, code)
7271
})
7372

7473
const watcher = this.compiler.tsCompiler.watcher(config)

0 commit comments

Comments
 (0)