@@ -54,7 +54,6 @@ class Watching {
5454this . running  =  false ; 
5555this . _initial  =  true ; 
5656this . _needRecords  =  true ; 
57- this . _needWatcherInfo  =  false ; 
5857this . watcher  =  undefined ; 
5958this . pausedWatcher  =  undefined ; 
6059this . _done  =  this . _done . bind ( this ) ; 
@@ -84,21 +83,6 @@ class Watching {
8483} ) ; 
8584} 
8685this . invalid  =  false ; 
87- if  ( this . _needWatcherInfo )  { 
88- this . _needWatcherInfo  =  false ; 
89- const  watcher  =  this . pausedWatcher ; 
90- if  ( watcher )  { 
91- this . compiler . modifiedFiles  =  watcher . aggregatedChanges ; 
92- this . compiler . removedFiles  =  watcher . aggregatedRemovals ; 
93- this . compiler . fileTimestamps  =  watcher . getFileTimeInfoEntries ( ) ; 
94- this . compiler . contextTimestamps  =  watcher . getContextTimeInfoEntries ( ) ; 
95- }  else  { 
96- this . compiler . modifiedFiles  =  undefined ; 
97- this . compiler . removedFiles  =  undefined ; 
98- this . compiler . fileTimestamps  =  undefined ; 
99- this . compiler . contextTimestamps  =  undefined ; 
100- } 
101- } 
10286this . compiler . hooks . watchRun . callAsync ( this . compiler ,  err  =>  { 
10387if  ( err )  return  this . _done ( err ) ; 
10488const  onCompiled  =  ( err ,  compilation )  =>  { 
@@ -277,6 +261,11 @@ class Watching {
277261this . compiler . contextTimestamps  =  contextTimeInfoEntries ; 
278262this . compiler . removedFiles  =  removedFiles ; 
279263this . compiler . modifiedFiles  =  changedFiles ; 
264+ if  ( this . watcher )  { 
265+ this . pausedWatcher  =  this . watcher ; 
266+ this . watcher . pause ( ) ; 
267+ this . watcher  =  null ; 
268+ } 
280269this . _invalidate ( ) ; 
281270this . _onChange ( ) ; 
282271} , 
@@ -297,7 +286,6 @@ class Watching {
297286} 
298287if  ( ! this . _initial )  { 
299288this . compiler . hooks . invalid . call ( null ,  Date . now ( ) ) ; 
300- this . _needWatcherInfo  =  true ; 
301289} 
302290this . _invalidate ( ) ; 
303291} 
@@ -309,6 +297,14 @@ class Watching {
309297return ; 
310298} 
311299if  ( this . watcher )  { 
300+ this . compiler . modifiedFiles  = 
301+ this . watcher . getAggregatedChanges  && 
302+ this . watcher . getAggregatedChanges ( ) ; 
303+ this . compiler . removedFiles  = 
304+ this . watcher . getAggregatedRemovals  && 
305+ this . watcher . getAggregatedRemovals ( ) ; 
306+ this . compiler . fileTimestamps  =  this . watcher . getFileTimeInfoEntries ( ) ; 
307+ this . compiler . contextTimestamps  =  this . watcher . getContextTimeInfoEntries ( ) ; 
312308this . pausedWatcher  =  this . watcher ; 
313309this . watcher . pause ( ) ; 
314310this . watcher  =  null ; 
@@ -328,7 +324,6 @@ class Watching {
328324resume ( )  { 
329325if  ( this . suspended )  { 
330326this . suspended  =  false ; 
331- this . _needWatcherInfo  =  true ; 
332327this . _invalidate ( ) ; 
333328} 
334329} 
0 commit comments