@@ -19,9 +19,9 @@ class CachePlugin {
1919 } ) ;
2020 } else {
2121 const registerCacheToCompiler = ( compiler , cache ) => {
22- compiler . plugin ( "this-compilation ", compilation => {
22+ compiler . hooks . thisCompilation . tap ( "CachePlugin ", ( compilation ) => {
2323 compilation . cache = cache ;
24- compilation . plugin ( "child-compiler ", ( childCompiler , compilerName , compilerIndex ) => {
24+ compilation . hooks . childCompiler . tap ( "CachePlugin ", ( childCompiler , compilerName , compilerIndex ) => {
2525 if ( cache ) {
2626 let childCache ;
2727 if ( ! cache . children ) cache . children = { } ;
@@ -36,11 +36,10 @@ class CachePlugin {
3636 } ) ;
3737 } ;
3838 registerCacheToCompiler ( compiler , this . cache ) ;
39- compiler . plugin ( "watch-run ", ( compiler , callback ) => {
39+ compiler . hooks . watchRun . tap ( "CachePlugin ", ( ) => {
4040 this . watching = true ;
41- callback ( ) ;
4241 } ) ;
43- compiler . plugin ( "run ", ( compiler , callback ) => {
42+ compiler . hooks . run . tapAsync ( "CachePlugin ", ( compiler , callback ) => {
4443 if ( ! compiler . _lastCompilationFileDependencies ) return callback ( ) ;
4544 const fs = compiler . inputFileSystem ;
4645 const fileTs = compiler . fileTimestamps = { } ;
@@ -65,10 +64,9 @@ class CachePlugin {
6564 callback ( ) ;
6665 } ) ;
6766 } ) ;
68- compiler . plugin ( "after-compile ", ( compilation , callback ) => {
67+ compiler . hooks . afterCompile . tap ( "CachePlugin ", ( compilation ) => {
6968 compilation . compiler . _lastCompilationFileDependencies = compilation . fileDependencies ;
7069 compilation . compiler . _lastCompilationContextDependencies = compilation . contextDependencies ;
71- callback ( ) ;
7270 } ) ;
7371 }
7472 }
0 commit comments