File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -166,9 +166,12 @@ class Watching {
166166 }
167167
168168 close ( callback ) {
169- if ( callback === undefined ) callback = ( ) => { } ;
169+ const finalCallback = ( ) => {
170+ this . compiler . hooks . watchClose . call ( ) ;
171+ this . compiler . running = false ;
172+ if ( callback !== undefined ) callback ( ) ;
173+ } ;
170174
171- this . compiler . running = false ;
172175 this . closed = true ;
173176 if ( this . watcher ) {
174177 this . watcher . close ( ) ;
@@ -180,13 +183,9 @@ class Watching {
180183 }
181184 if ( this . running ) {
182185 this . invalid = true ;
183- this . _done = ( ) => {
184- this . compiler . hooks . watchClose . call ( ) ;
185- callback ( ) ;
186- } ;
186+ this . _done = finalCallback ;
187187 } else {
188- this . compiler . hooks . watchClose . call ( ) ;
189- callback ( ) ;
188+ finalCallback ( ) ;
190189 }
191190 }
192191}
You can’t perform that action at this time.
0 commit comments