webpack hot reload middleware for koa
Webpack Hot Middleware
Installation & Usage
See example/ for an example of usage.
First, install the npm module.
npm install --save-dev koa-webpack-hot-middleware
Next, enable hot reloading in your webpack config:
Add the following three plugins to the
Occurence ensures consistent build hashes, hot module replacement is somewhat self-explanatory, no errors is used to handle errors more cleanly.
entryarray. This connects to the server to receive notifications when the bundle rebuilds and then updates your client bundle accordingly.
Now add the middleware into your server:
webpack-dev-middlewarethe usual wayvar webpack = ;var webpackConfig = ;var compiler = ;app;
koa-webpack-hot-middlewareattached to the same compiler instanceapp;
And you're all set!
Copyright 2015 Glen Mailer.