Manage HMR console output

Hi! Does anybody know how to manage console outputs when using HMR? For example, I’d like to clear the console between each HMR reload to facilitate debugging. I am able to do so with this code in the main entry point of my app:

if (module.hot) {
  module.hot.onRequire({
    after: () => console.clear(),
  });
}

However, it gets called for each individual module, not for the entire HMR update cycle. Thanks in advance!