Last active
August 28, 2018 17:40
-
-
Save SevInf/9f8cfca5c48c2474cc8e2815ea684e8a to your computer and use it in GitHub Desktop.
Webpack hot reloading example
This file contains hidden or 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
import { text } from './text.mjs'; | |
document.body.textContent = text; | |
module.hot && module.hot.accept('./text.mjs', () => { | |
// here text.mjs is updated and text variable has a new value | |
document.body.textContent = text; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment