@@ -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,18 @@ 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
- runtimeOnlyFiles = [ ] . concat ( ...compilation . chunkGroups
55
- // get the chunk group of each entry points (e.g. main.js and inspector-modules.js)
56
- . map ( chunkGroup => chunkGroup . runtimeChunk )
54
+ runtimeOnlyFiles = [ ] . concat ( ...Array . from < any > ( compilation . entrypoints . values ( ) )
55
+ . map ( entrypoint => entrypoint . runtimeChunk )
57
56
// filter embedded runtime chunks (e.g. part of bundle.js or inspector-modules.js)
58
- . filter ( runtimeChunk => runtimeChunk . preventIntegration )
57
+ . filter ( runtimeChunk => ! ! runtimeChunk && runtimeChunk . preventIntegration )
59
58
. map ( runtimeChunk => runtimeChunk . files ) )
60
59
// get only the unique files in case of "single" runtime (e.g. runtime.js)
61
60
. filter ( ( value , index , self ) => self . indexOf ( value ) === index )
62
61
// convert to absolute paths
63
- . map ( fileName => join ( compiler . context , fileName ) ) ;
62
+ . map ( fileName => join ( basePath , fileName ) ) ;
64
63
} catch ( e ) {
65
64
// breaking change in the Webpack API
66
65
console . log ( "Warning: Unable to find Webpack runtime files." ) ;
0 commit comments