Skip to content

Commit 621d656

Browse files
author
Diogo Franco (Kovensky)
committed
Fix only-dev-server.js's module.hot.apply call
It had not been updated to webpack 2's Promise ways, so the callback never happened.
1 parent 8e22c6b commit 621d656

1 file changed

Lines changed: 11 additions & 14 deletions

File tree

hot/only-dev-server.js

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,7 @@ if(module.hot) {
1818

1919
module.hot.apply({
2020
ignoreUnaccepted: true
21-
}, function(err, renewedModules) {
22-
if(err) {
23-
if(module.hot.status() in {
24-
abort: 1,
25-
fail: 1
26-
}) {
27-
console.warn("[HMR] Cannot apply update. Need to do a full reload!");
28-
console.warn("[HMR] " + err.stack || err.message);
29-
} else {
30-
console.warn("[HMR] Update failed: " + err.stack || err.message);
31-
}
32-
return;
33-
}
34-
21+
}).then(function(renewedModules) {
3522
if(!upToDate()) {
3623
check();
3724
}
@@ -41,6 +28,16 @@ if(module.hot) {
4128
if(upToDate()) {
4229
console.log("[HMR] App is up to date.");
4330
}
31+
}).catch(function(err) {
32+
if(module.hot.status() in {
33+
abort: 1,
34+
fail: 1
35+
}) {
36+
console.warn("[HMR] Cannot apply update. Need to do a full reload!");
37+
console.warn("[HMR] " + err.stack || err.message);
38+
} else {
39+
console.warn("[HMR] Update failed: " + err.stack || err.message);
40+
}
4441
});
4542
}).catch(function(err) {
4643
if(module.hot.status() in {

0 commit comments

Comments
 (0)