/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
examples/hot-module-replacement/node.js
14 строк
398 B
Alexander Akait
docs: add Hot Module Replacement examples for web, node and universal (#21222)
19 июн 2026, 13:54
Не верифицирован
19 июн 2026, 13:54
5ee4706
Код
Авторство
О чём код?
// Node HMR: there is no EventSource, so a Node trigger drives the check. // `webpack/hot/poll` re-checks on a timer; `webpack/hot/signal` waits for // SIGUSR2. Run with `webpack --watch` and `node dist/node/main.js`. import "webpack/hot/poll?1000"; const render = () => { console.log("message:", require("./message")); }; render(); if (module.hot) { module.hot.accept("./message", render); }