koa2-webpack-middleware
koa2 middleware with HMR(hot module replacement) supports
依赖
修改自
Install
$ npm install koa2-webpack-middleware -D
Usage
const compile = app app
HMR configure
-
webpack
plugins
configureplugins: -
webpack
entry
configureentry:'index':'webpack-hot-middleware/client?path=/__webpack_hmr&timeout=20000''index.js' -
put the code in your entry file to enable HMR
Pure JS need
if modulehotmodulehotaccept
更多配置说明参考