Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 531230e

Browse files
sis0k0DimitarTachev
and
DimitarTachev
authored
chore: apply PR suggestions
Co-Authored-By: DimitarTachev <[email protected]>
1 parent be82ab7 commit 531230e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: plugins/WatchStateLoggerPlugin.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class WatchStateLoggerPlugin {
3131
console.log(messages.compilationComplete);
3232
}
3333

34-
const runtimeOnlyFiles = getWebpackRuntimeOnlyFiles(compilation, compiler);
34+
const runtimeOnlyFiles = getWebpackRuntimeOnlyFiles(compilation, compiler.context);
3535
let emittedFiles = Object
3636
.keys(compilation.assets)
3737
.filter(assetKey => compilation.assets[assetKey].emitted);
@@ -48,19 +48,19 @@ export class WatchStateLoggerPlugin {
4848
}
4949
}
5050

51-
function getWebpackRuntimeOnlyFiles(compilation, compiler) {
51+
function getWebpackRuntimeOnlyFiles(compilation, basePath) {
5252
let runtimeOnlyFiles = [];
5353
try {
5454
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)
5656
.map(chunkGroup => chunkGroup.runtimeChunk)
5757
// filter embedded runtime chunks (e.g. part of bundle.js or inspector-modules.js)
5858
.filter(runtimeChunk => runtimeChunk.preventIntegration)
5959
.map(runtimeChunk => runtimeChunk.files))
6060
// get only the unique files in case of "single" runtime (e.g. runtime.js)
6161
.filter((value, index, self) => self.indexOf(value) === index)
6262
// convert to absolute paths
63-
.map(fileName => join(compiler.context, fileName));
63+
.map(fileName => join(basePath, fileName));
6464
} catch (e) {
6565
// breaking change in the Webpack API
6666
console.log("Warning: Unable to find Webpack runtime files.");

0 commit comments

Comments
 (0)