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

fix: hmr should work with uglify #953

Merged
merged 1 commit into from
Jun 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions plugins/WatchStateLoggerPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,9 @@ function getWebpackRuntimeOnlyFiles(compilation) {
function getEntryPointFiles(compilation) {
const entryPointFiles = [];
try {
Array.from(compilation.entrypoints.values())
Array.from(compilation.entrypoints.values())
.forEach((entrypoint: any) => {
const entryChunk = entrypoint.chunks.find(chunk => chunk.name === entrypoint.options.name);
if (entryChunk) {
for (const entryChunk of entrypoint.chunks) {
entryChunk.files.forEach(fileName => {
if (fileName.indexOf("hot-update") === -1) {
entryPointFiles.push(fileName);
Expand All @@ -79,5 +78,6 @@ function getEntryPointFiles(compilation) {
console.log("Warning: Unable to find Webpack entry point files.");
}

return entryPointFiles;
return entryPointFiles
.filter((value, index, self) => self.indexOf(value) === index); // get only the unique files
}