diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:01:11 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:02:09 +0200 |
commit | 363723fc84f7b8477592e0105aeb331ec9a017af (patch) | |
tree | 29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/webpack/hot/dev-server.js | |
parent | 5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff) |
node_modules
Diffstat (limited to 'node_modules/webpack/hot/dev-server.js')
-rw-r--r-- | node_modules/webpack/hot/dev-server.js | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/node_modules/webpack/hot/dev-server.js b/node_modules/webpack/hot/dev-server.js index da39afedd..95894674d 100644 --- a/node_modules/webpack/hot/dev-server.js +++ b/node_modules/webpack/hot/dev-server.js @@ -8,11 +8,12 @@ if(module.hot) { var upToDate = function upToDate() {
return lastHash.indexOf(__webpack_hash__) >= 0;
};
+ var log = require("./log");
var check = function check() {
module.hot.check(true).then(function(updatedModules) {
if(!updatedModules) {
- console.warn("[HMR] Cannot find update. Need to do a full reload!");
- console.warn("[HMR] (Probably because of restarting the webpack-dev-server)");
+ log("warning", "[HMR] Cannot find update. Need to do a full reload!");
+ log("warning", "[HMR] (Probably because of restarting the webpack-dev-server)");
window.location.reload();
return;
}
@@ -24,17 +25,17 @@ if(module.hot) { require("./log-apply-result")(updatedModules, updatedModules);
if(upToDate()) {
- console.log("[HMR] App is up to date.");
+ log("info", "[HMR] App is up to date.");
}
}).catch(function(err) {
var status = module.hot.status();
if(["abort", "fail"].indexOf(status) >= 0) {
- console.warn("[HMR] Cannot apply update. Need to do a full reload!");
- console.warn("[HMR] " + err.stack || err.message);
+ log("warning", "[HMR] Cannot apply update. Need to do a full reload!");
+ log("warning", "[HMR] " + err.stack || err.message);
window.location.reload();
} else {
- console.warn("[HMR] Update failed: " + err.stack || err.message);
+ log("warning", "[HMR] Update failed: " + err.stack || err.message);
}
});
};
@@ -42,11 +43,11 @@ if(module.hot) { hotEmitter.on("webpackHotUpdate", function(currentHash) {
lastHash = currentHash;
if(!upToDate() && module.hot.status() === "idle") {
- console.log("[HMR] Checking for updates on the server...");
+ log("info", "[HMR] Checking for updates on the server...");
check();
}
});
- console.log("[HMR] Waiting for update signal from WDS...");
+ log("info", "[HMR] Waiting for update signal from WDS...");
} else {
throw new Error("[HMR] Hot Module Replacement is disabled.");
}
|