diff --git a/templates/ReactSpa/ClientApp/routes.tsx b/templates/ReactSpa/ClientApp/routes.tsx index 6084614..5a3dafb 100644 --- a/templates/ReactSpa/ClientApp/routes.tsx +++ b/templates/ReactSpa/ClientApp/routes.tsx @@ -10,3 +10,9 @@ export default ; + +// Allow Hot Module Reloading +declare var module: any; +if (module.hot) { + module.hot.accept(); +} diff --git a/templates/ReactSpa/webpack.config.vendor.js b/templates/ReactSpa/webpack.config.vendor.js index 4917bcb..8a95bb3 100644 --- a/templates/ReactSpa/webpack.config.vendor.js +++ b/templates/ReactSpa/webpack.config.vendor.js @@ -29,6 +29,9 @@ module.exports = { new webpack.DllPlugin({ path: path.join(__dirname, 'wwwroot', 'dist', '[name]-manifest.json'), name: '[name]_[hash]' + }), + new webpack.DefinePlugin({ + 'process.env.NODE_ENV': isDevBuild ? '"development"' : '"production"' }) ].concat(isDevBuild ? [] : [ new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } })