@@ -31,7 +31,7 @@ export class WatchStateLoggerPlugin {
31
31
console . log ( messages . compilationComplete ) ;
32
32
}
33
33
34
- const runtimeOnlyFiles = getWebpackRuntimeOnlyFiles ( compilation , compiler ) ;
34
+ const runtimeOnlyFiles = getWebpackRuntimeOnlyFiles ( compilation , compiler . context ) ;
35
35
let emittedFiles = Object
36
36
. keys ( compilation . assets )
37
37
. filter ( assetKey => compilation . assets [ assetKey ] . emitted ) ;
@@ -48,19 +48,19 @@ export class WatchStateLoggerPlugin {
48
48
}
49
49
}
50
50
51
- function getWebpackRuntimeOnlyFiles ( compilation , compiler ) {
51
+ function getWebpackRuntimeOnlyFiles ( compilation , basePath ) {
52
52
let runtimeOnlyFiles = [ ] ;
53
53
try {
54
54
runtimeOnlyFiles = [ ] . concat ( ...compilation . chunkGroups
55
- // get the chunk group of each entry points (e.g. main.js and inspector-modules.js)
55
+ // get the runtime chunk (e.g. runtime.js) of each entry point (e.g. main.js and inspector-modules.js)
56
56
. map ( chunkGroup => chunkGroup . runtimeChunk )
57
57
// filter embedded runtime chunks (e.g. part of bundle.js or inspector-modules.js)
58
58
. filter ( runtimeChunk => runtimeChunk . preventIntegration )
59
59
. map ( runtimeChunk => runtimeChunk . files ) )
60
60
// get only the unique files in case of "single" runtime (e.g. runtime.js)
61
61
. filter ( ( value , index , self ) => self . indexOf ( value ) === index )
62
62
// convert to absolute paths
63
- . map ( fileName => join ( compiler . context , fileName ) ) ;
63
+ . map ( fileName => join ( basePath , fileName ) ) ;
64
64
} catch ( e ) {
65
65
// breaking change in the Webpack API
66
66
console . log ( "Warning: Unable to find Webpack runtime files." ) ;
0 commit comments