Enable Webpack dev middleware and React hot module replacement

This commit is contained in:
SteveSandersonMS
2016-02-02 15:26:15 +00:00
parent 003918721d
commit 8ef9ab31a7
6 changed files with 185 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.SpaServices;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
@@ -51,6 +52,11 @@ namespace ReactExample
// send the request to the following path or controller action.
app.UseExceptionHandler("/Home/Error");
}
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions {
HotModuleReplacement = true,
ReactHotModuleReplacement = true
});
// Add static files to the request pipeline.
app.UseStaticFiles();