Webpack HMR wondered why this accept was only executed once.

in the hot replacement of the HMR module in the official webpack documentation, the following code is used to modify the code in print.js, but why is it only executed once? is it because there is a cache after the module replacement, or is there some other mechanism that causes this function to be executed only once

clipboard.png

if(module.hot){
      module.hot.accept("./print.js",function(){
          console.log("Accepting the updated printMe module!");
      })
}
May.24,2021
Menu