From f0e99c124fec413e704d4e30ac466c76bfc10437 Mon Sep 17 00:00:00 2001 From: Allen Short Date: Fri, 9 Nov 2018 12:19:50 -0600 Subject: [PATCH] Use production build of react when deployed (fixes #606) --- webpack.config.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/webpack.config.js b/webpack.config.js index a413079ea7..55eca679c2 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -232,6 +232,14 @@ if (process.env.DEV_SERVER_HOST) { config.devServer.host = process.env.DEV_SERVER_HOST; } +if (isProduction) { + config.plugins.push( + new webpack.DefinePlugin({ + 'process.env.NODE_ENV': JSON.stringify('production') + }) + ); +} + if (process.env.BUNDLE_ANALYZER) { config.plugins.push(new BundleAnalyzerPlugin()); }