devserver:{hot:true},既及时更新代码,样式(需配合loader)变化,自动重编译,只适用于开发环境。
入口文件中,添加监视:
+ if (module.hot) {
+ module.hot.accept('./print.js', function() {
+ console.log('Accepting the updated printMe module!');
+ printMe();
+ })
+ }
devserver:{hot:true},既及时更新代码,样式(需配合loader)变化,自动重编译,只适用于开发环境。
入口文件中,添加监视:
+ if (module.hot) {
+ module.hot.accept('./print.js', function() {
+ console.log('Accepting the updated printMe module!');
+ printMe();
+ })
+ }