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();

View File

@@ -15,13 +15,18 @@
},
"devDependencies": {
"babel-loader": "^6.2.1",
"babel-plugin-react-transform": "^2.0.0",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"css-loader": "^0.21.0",
"express": "^4.13.4",
"extract-text-webpack-plugin": "^0.8.2",
"file-loader": "^0.8.4",
"react-transform-hmr": "^1.0.1",
"style-loader": "^0.13.0",
"url-loader": "^0.5.6",
"webpack": "^1.12.2"
"webpack": "^1.12.2",
"webpack-dev-middleware": "^1.5.1",
"webpack-hot-middleware": "^2.6.4"
}
}