Created
February 21, 2019 20:54
-
-
Save DeMoorJasper/439d6657538e31f19245a2109bbafff7 to your computer and use it in GitHub Desktop.
HMR Util
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function wrapHMR(module) { | |
if (module.hot) { | |
module.hot.dispose(() => { | |
window.location.reload(); | |
}); | |
} | |
return module; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("./hmr")(module); | |
document.getElementById("hey").innerHTML = | |
document.getElementById("hey").innerHTML + "<h1>oioioioioioioiioioiooioioi</h1>"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment