I have a little project and decided to try webpack for it.
Using Hot reload I was able to bundle everything and update on change of js or sass.
The thing is, I have some event liteners like
btn.addEventListener('click', function () {
//do something
});
When I change some code inside those listeners, hot reload shows the updated code, but the binded element is the old one.
I'm using vainilla js.
Is there a way to rebind all the listeners without manually removing the event listeners?