Live2D

dev-client.js-配合dev-server.js监听html文件改动也能够触发自动刷新

// 引入 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();
    }
})

 

posted @ 2018-03-09 16:52  Candice&Gladys  阅读(248)  评论(0编辑  收藏  举报