Hot Module Replacement allows to add, change or delete app module when application is running. Page reloading is not needed in this case.
In addition to webpack-dev-middleware
packages:
npm install --save-dev webpack-hot-middleware
Simply update configuration of UseWebpackDevMiddleware
with new options:
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions()
{
ConfigFile = "webpack.config.js", //this is defualt value
HotModuleReplacement = true,
ReactHotModuleReplacement = true, //for React only
});
You also need to accept hot modules in your app code.
HMR is supported for Angular 2, React, Knockout and Vue.