diff --git a/local-cli/server/util/attachHMRServer.js b/local-cli/server/util/attachHMRServer.js index 54f510fd7..f46114142 100644 --- a/local-cli/server/util/attachHMRServer.js +++ b/local-cli/server/util/attachHMRServer.js @@ -111,6 +111,9 @@ function attachHMRServer({httpServer, path, packagerServer}) { if (!client) { return; } + console.log( + `[Hot Module Replacement] File change detected (${time()})` + ); client.ws.send(JSON.stringify({type: 'update-start'})); stat.then(() => { @@ -230,6 +233,10 @@ function attachHMRServer({httpServer, path, packagerServer}) { return; } + console.log( + '[Hot Module Replacement] Sending HMR update to client (' + + time() + ')' + ); client.ws.send(update); }); }, @@ -263,4 +270,9 @@ function arrayEquals(arrayA, arrayB) { ); } +function time() { + const date = new Date(); + return `${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}:${date.getMilliseconds()}`; +} + module.exports = attachHMRServer;