Skip to content

Commit 69cc31c

Browse files
committed
fixed HMR bug
1 parent 382635d commit 69cc31c

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

hot/dev-server.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ if(module.hot) {
3535
});
3636
}
3737
window.onmessage = function(event) {
38-
if(module.hot.status() === "idle" && typeof event.data === "string" && event.data.indexOf("webpackHotUpdate") === 0) {
38+
if(typeof event.data === "string" && event.data.indexOf("webpackHotUpdate") === 0) {
3939
lastData = event.data;
40-
console.log("[HMR] Checking for updates on the server...");
41-
check();
40+
if(module.hot.status() === "idle") {
41+
console.log("[HMR] Checking for updates on the server...");
42+
check();
43+
}
4244
}
4345
};
4446
}

0 commit comments

Comments
 (0)