From 363723fc84f7b8477592e0105aeb331ec9a017af Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 14 Aug 2017 05:01:11 +0200 Subject: node_modules --- node_modules/webpack/hot/only-dev-server.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'node_modules/webpack/hot/only-dev-server.js') diff --git a/node_modules/webpack/hot/only-dev-server.js b/node_modules/webpack/hot/only-dev-server.js index 214f757f6..252df58fd 100644 --- a/node_modules/webpack/hot/only-dev-server.js +++ b/node_modules/webpack/hot/only-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().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)"); return; } @@ -21,13 +22,14 @@ if(module.hot) { ignoreDeclined: true, ignoreErrored: true, onUnaccepted: function(data) { - console.warn("Ignored an update to unaccepted module " + data.chain.join(" -> ")); + log("warning", "Ignored an update to unaccepted module " + data.chain.join(" -> ")); }, onDeclined: function(data) { - console.warn("Ignored an update to declined module " + data.chain.join(" -> ")); + log("warning", "Ignored an update to declined module " + data.chain.join(" -> ")); }, onErrored: function(data) { - console.warn("Ignored an error while updating module " + data.moduleId + " (" + data.type + ")"); + log("error", data.error); + log("warning", "Ignored an error while updating module " + data.moduleId + " (" + data.type + ")"); } }).then(function(renewedModules) { if(!upToDate()) { @@ -37,16 +39,16 @@ if(module.hot) { require("./log-apply-result")(updatedModules, renewedModules); 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 check for update. Need to do a full reload!"); - console.warn("[HMR] " + err.stack || err.message); + log("warning", "[HMR] Cannot check for update. Need to do a full reload!"); + log("warning", "[HMR] " + err.stack || err.message); } else { - console.warn("[HMR] Update check failed: " + err.stack || err.message); + log("warning", "[HMR] Update check failed: " + err.stack || err.message); } }); }; @@ -56,14 +58,14 @@ if(module.hot) { if(!upToDate()) { var status = module.hot.status(); if(status === "idle") { - console.log("[HMR] Checking for updates on the server..."); + log("info", "[HMR] Checking for updates on the server..."); check(); } else if(["abort", "fail"].indexOf(status) >= 0) { - console.warn("[HMR] Cannot apply update as a previous update " + status + "ed. Need to do a full reload!"); + log("warning", "[HMR] Cannot apply update as a previous update " + status + "ed. Need to do a full reload!"); } } }); - 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."); } -- cgit v1.2.3