Only use Webpack Dev Middleware in dev mode
This commit is contained in:
parent
8ef9ab31a7
commit
e59e2e0328
|
|
@ -53,10 +53,14 @@ namespace ReactExample
|
||||||
app.UseExceptionHandler("/Home/Error");
|
app.UseExceptionHandler("/Home/Error");
|
||||||
}
|
}
|
||||||
|
|
||||||
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions {
|
// In dev mode, the JS/TS/etc is compiled and served dynamically and supports hot replacement.
|
||||||
HotModuleReplacement = true,
|
// In production, we assume you've used webpack to emit the prebuilt content to disk.
|
||||||
ReactHotModuleReplacement = true
|
if (env.IsDevelopment()) {
|
||||||
});
|
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions {
|
||||||
|
HotModuleReplacement = true,
|
||||||
|
ReactHotModuleReplacement = true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Add static files to the request pipeline.
|
// Add static files to the request pipeline.
|
||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue