From f1dfa264e456cb9e52d6297654635f3e8ffefeee 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 e782dbedbb..a13a233a3f 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -230,6 +230,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()); }