mirror of https://github.com/webpack/webpack.git
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.
This commit is contained in:
parent
8e22c6b92e
commit
621d656573
|
@ -18,20 +18,7 @@ if(module.hot) {
|
|||
|
||||
module.hot.apply({
|
||||
ignoreUnaccepted: true
|
||||
}, function(err, renewedModules) {
|
||||
if(err) {
|
||||
if(module.hot.status() in {
|
||||
abort: 1,
|
||||
fail: 1
|
||||
}) {
|
||||
console.warn("[HMR] Cannot apply update. Need to do a full reload!");
|
||||
console.warn("[HMR] " + err.stack || err.message);
|
||||
} else {
|
||||
console.warn("[HMR] Update failed: " + err.stack || err.message);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
}).then(function(renewedModules) {
|
||||
if(!upToDate()) {
|
||||
check();
|
||||
}
|
||||
|
@ -41,6 +28,16 @@ if(module.hot) {
|
|||
if(upToDate()) {
|
||||
console.log("[HMR] App is up to date.");
|
||||
}
|
||||
}).catch(function(err) {
|
||||
if(module.hot.status() in {
|
||||
abort: 1,
|
||||
fail: 1
|
||||
}) {
|
||||
console.warn("[HMR] Cannot apply update. Need to do a full reload!");
|
||||
console.warn("[HMR] " + err.stack || err.message);
|
||||
} else {
|
||||
console.warn("[HMR] Update failed: " + err.stack || err.message);
|
||||
}
|
||||
});
|
||||
}).catch(function(err) {
|
||||
if(module.hot.status() in {
|
||||
|
|
Loading…
Reference in New Issue