examples/hot-module-replacement/template.md
This example shows Hot Module Replacement (HMR) for the three platform setups, all sharing one module that gets hot-swapped at runtime.
The download/apply runtime is the same everywhere; only the trigger (what tells the app to check for an update) differs:
webpack/hot/dev-server reacts to the update signal pushed by webpack-dev-server over EventSource. Run it with webpack serve.webpack/hot/poll re-checks on a timer (webpack/hot/signal waits for a process signal). Run it with webpack --watch and node dist/node/main.js, then edit message.js.webpack/hot/dev-server is universal: it consumes the same update signal on either platform (a browser dev-server, or a Node dev-server/middleware feeding the emitter), so no per-target client is needed.Edit message.js while the app runs to see the module reload in place — no full restart, no page reload.
_{{message.js}}_
_{{web.js}}_
_{{node.js}}_
_{{universal.js}}_
_{{webpack.config.js}}_