diff --git a/src/builtins/hmr-runtime.js b/src/builtins/hmr-runtime.js index 30e90ec1217..82565983aa3 100644 --- a/src/builtins/hmr-runtime.js +++ b/src/builtins/hmr-runtime.js @@ -15,7 +15,7 @@ function Module() { module.bundle.Module = Module; if (!module.bundle.parent && typeof WebSocket !== 'undefined') { - var ws = new WebSocket('ws://' + window.location.hostname + ':{{HMR_PORT}}/'); + var ws = new WebSocket('ws://' + location.hostname + ':{{HMR_PORT}}/'); ws.onmessage = function(event) { var data = JSON.parse(event.data); @@ -34,7 +34,7 @@ if (!module.bundle.parent && typeof WebSocket !== 'undefined') { if (data.type === 'reload') { ws.close(); ws.onclose = function () { - window.location.reload(); + location.reload(); } }