mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Add Webpack dev middleware and React hot module replacement to ReactSpa template
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Linq;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.Builder;
|
using Microsoft.AspNet.Builder;
|
||||||
using Microsoft.AspNet.Hosting;
|
using Microsoft.AspNet.Hosting;
|
||||||
|
using Microsoft.AspNet.SpaServices.Webpack;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
@@ -46,6 +47,15 @@ namespace WebApplicationBasic
|
|||||||
}
|
}
|
||||||
|
|
||||||
app.UseIISPlatformHandler();
|
app.UseIISPlatformHandler();
|
||||||
|
|
||||||
|
if (env.IsDevelopment())
|
||||||
|
{
|
||||||
|
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions
|
||||||
|
{
|
||||||
|
HotModuleReplacement = true,
|
||||||
|
ReactHotModuleReplacement = true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
|
|
||||||
|
|||||||
@@ -3,19 +3,24 @@
|
|||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-loader": "^6.2.3",
|
"babel-loader": "^6.2.3",
|
||||||
|
"babel-plugin-react-transform": "^2.0.0",
|
||||||
"babel-preset-es2015": "^6.5.0",
|
"babel-preset-es2015": "^6.5.0",
|
||||||
"babel-preset-react": "^6.5.0",
|
"babel-preset-react": "^6.5.0",
|
||||||
"bootstrap": "^3.3.6",
|
"bootstrap": "^3.3.6",
|
||||||
"css-loader": "^0.23.1",
|
"css-loader": "^0.23.1",
|
||||||
|
"express": "^4.13.4",
|
||||||
"extendify": "^1.0.0",
|
"extendify": "^1.0.0",
|
||||||
"extract-text-webpack-plugin": "^1.0.1",
|
"extract-text-webpack-plugin": "^1.0.1",
|
||||||
"file-loader": "^0.8.5",
|
"file-loader": "^0.8.5",
|
||||||
"jquery": "^2.2.1",
|
"jquery": "^2.2.1",
|
||||||
|
"react-transform-hmr": "^1.0.2",
|
||||||
"style-loader": "^0.13.0",
|
"style-loader": "^0.13.0",
|
||||||
"ts-loader": "^0.8.1",
|
"ts-loader": "^0.8.1",
|
||||||
"typescript": "^1.8.2",
|
"typescript": "^1.8.2",
|
||||||
"url-loader": "^0.5.7",
|
"url-loader": "^0.5.7",
|
||||||
"webpack": "^1.12.14"
|
"webpack": "^1.12.14",
|
||||||
|
"webpack-dev-middleware": "^1.5.1",
|
||||||
|
"webpack-hot-middleware": "^2.7.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"babel-core": "^6.5.2",
|
"babel-core": "^6.5.2",
|
||||||
|
|||||||
Reference in New Issue
Block a user