Skip to content

Commit

Permalink
fix(vite): improve initial load, close #1565
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Sep 26, 2022
1 parent 8abebfd commit b8c8844
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/vite/src/modes/global/dev.ts
Expand Up @@ -96,8 +96,15 @@ export function GlobalModeDevPlugin({ uno, tokens, affectedModules, onInvalidate
servers.push(_server)

_server.ws.on(WS_EVENT_PREFIX, ([layer, hash]: string[]) => {
if (lastServedHash.get(layer) !== hash)
if (lastServedHash.get(layer) !== hash) {
sendUpdate(entries)
}
else {
setTimeout(() => {
if (lastServedHash.get(layer) !== hash)
sendUpdate(entries)
}, 50)
}
})
},
buildStart() {
Expand Down

0 comments on commit b8c8844

Please sign in to comment.