Enable Webpack dev middleware and basic (non-state-preserving) HMR for Angular template

This commit is contained in:
SteveSandersonMS
2016-02-29 10:48:26 +00:00
parent c1b808f8af
commit d102fdb363
3 changed files with 22 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.SpaServices.Webpack;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
@@ -46,6 +47,14 @@ namespace WebApplicationBasic
}
app.UseIISPlatformHandler();
if (env.IsDevelopment())
{
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions
{
HotModuleReplacement = true
});
}
app.UseStaticFiles();