Skip to content

Commit

Permalink
Use production build of react when deployed (fixes getredash#606)
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Short authored and jezdez committed Jan 16, 2020
1 parent 1dc6c4a commit d3ebc46
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,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());
}
Expand Down

0 comments on commit d3ebc46

Please sign in to comment.