Detecting HMR replace

Hey, I’m using webpack 4 with aurelia-hot-model-reload (HMR) and would like to be able to detect when something is being, or has been, replaced in the HMR process.

Maybe it would help to know which callbacks in the Aurelia component lifecycle are triggered during the replacement, but I haven’t seen anything on that nor had much luck with them (though a hack occurred to me). Maybe would be nice if aurelia-hot-model-reload had its own set of events it could fire.

Maybe one must use the MutationObserver?

Any suggestions? Thanks!