While trying to set up my new development environment (node server + client with only vanilla js on board), I faced with webpack-hot-middleware for hot reloading my front-end changes. And everything would be fine, but if there are any code like this
$button.addEventListener('click', () => {
// any code here
});
than after hot reloading, when you click on $button, this event listener will fire one more time than before! Terribly uncomfortable, but I did not found any reports of a similar problem from anyone. Can anyone help me with possible workarounds of this problem?