@@ -364,14 +364,14 @@ const filterMtimes = (mtimes: any) => {
364364}
365365
366366function setupWatchRun ( compiler , instanceName : string ) {
367- compiler . plugin ( 'watch-run ', function ( watching , callback ) {
368- const instance = resolveInstance ( watching . compiler , instanceName )
367+ compiler . hooks . watchRun . tap ( 'at-loader ', function ( compiler , callback ) {
368+ const instance = resolveInstance ( compiler , instanceName )
369369 const checker = instance . checker
370370 const watcher =
371- watching . compiler . watchFileSystem . watcher ||
372- watching . compiler . watchFileSystem . wfs . watcher
371+ compiler . watchFileSystem . watcher ||
372+ compiler . watchFileSystem . wfs . watcher
373373
374- const startTime = instance . startTime || watching . startTime
374+ const startTime = instance . startTime || compiler . startTime
375375 const times = filterMtimes ( watcher . getTimes ( ) )
376376 const lastCompiled = instance . compiledFiles
377377
@@ -442,7 +442,7 @@ function isWatching(compiler: any): WatchMode {
442442}
443443
444444function setupAfterCompile ( compiler , instanceName , forkChecker = false ) {
445- compiler . plugin ( 'after-compile ', function ( compilation , callback ) {
445+ compiler . hooks . afterCompile . tap ( 'at-loader ', function ( compilation , callback ) {
446446 // Don"t add errors for child compilations
447447 if ( compilation . compiler . isChild ( ) ) {
448448 callback ( )
@@ -467,12 +467,7 @@ function setupAfterCompile(compiler, instanceName, forkChecker = false) {
467467 }
468468
469469 const files = instance . checker . getFiles ( ) . then ( ( { files } ) => {
470- const normalized = files . map ( file => {
471- const rpath = path . normalize ( file )
472- instance . compiledFiles [ file ] = true
473- return rpath
474- } )
475- Array . prototype . push . apply ( compilation . fileDependencies , normalized )
470+ Array . prototype . push . apply ( compilation . fileDependencies , files . map ( path . normalize ) )
476471 } )
477472
478473 const timeStart = + new Date ( )
0 commit comments