Skip to content

Commit

Permalink
refactor(hmr): simplify fetchUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Aug 28, 2022
1 parent 18f0ea9 commit 32f3168
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/vite/src/client/client.ts
Expand Up @@ -405,11 +405,8 @@ async function fetchUpdate({ path, acceptedPath, timestamp }: Update) {
deps.includes(acceptedPath)
)

const moduleToUpdate =
isSelfUpdate || qualifiedCallbacks.length > 0 ? acceptedPath : undefined

if (moduleToUpdate !== undefined) {
const dep = moduleToUpdate
if (isSelfUpdate || qualifiedCallbacks.length > 0) {
const dep = acceptedPath
const disposer = disposeMap.get(dep)
if (disposer) await disposer(dataMap.get(dep))
const [path, query] = dep.split(`?`)
Expand Down

0 comments on commit 32f3168

Please sign in to comment.