// 引入 webpack-hot-middleware/client 
var hotClient = require('webpack-hot-middleware/client');

// 订阅事件,当 event.action === 'reload' 时执行页面刷新
hotClient.subscribe(function (event) {
    if (event.action === 'reload') {
        window.location.reload();
    }
})

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-13
  • 2021-12-28
  • 2021-08-15
  • 2022-12-23
  • 2022-02-01
猜你喜欢
  • 2021-04-24
  • 2021-08-06
  • 2021-10-31
  • 2022-12-23
相关资源
相似解决方案