Skip to content

Instantly share code, notes, and snippets.

@SevInf
Last active August 28, 2018 17:40
Show Gist options
  • Save SevInf/9f8cfca5c48c2474cc8e2815ea684e8a to your computer and use it in GitHub Desktop.
Save SevInf/9f8cfca5c48c2474cc8e2815ea684e8a to your computer and use it in GitHub Desktop.
Webpack hot reloading example
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