Skip to content

Commit

Permalink
fix(hmr): do not update on file unlink when there are no affected mod…
Browse files Browse the repository at this point in the history
…ules (#1818)
  • Loading branch information
CHOYSEN committed Jan 30, 2021
1 parent 99da554 commit 59fe913
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/vite/src/node/server/hmr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,14 @@ export async function handleFileAddUnlink(
modules.push(module)
}
}
updateModules(
getShortName(file, server.config.root),
modules,
Date.now(),
server
)
if (modules.length > 0) {
updateModules(
getShortName(file, server.config.root),
modules,
Date.now(),
server
)
}
}
}

Expand Down

0 comments on commit 59fe913

Please sign in to comment.