Skip to content

Commit

Permalink
Define NODE_ENV to use the production build of React on slatejs.org (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
schneidmaster authored and ianstormtaylor committed Jul 1, 2018
1 parent a698d4a commit 001460f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions support/webpack/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')

const DefinePlugin = webpack.DefinePlugin
const NamedModulesPlugin = webpack.NamedModulesPlugin
const HotModuleReplacementPlugin = webpack.HotModuleReplacementPlugin
const IS_PROD = process.env.NODE_ENV === 'production'
Expand Down Expand Up @@ -57,6 +58,11 @@ const config = {
],
},
plugins: [
new DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(
IS_PROD ? 'production' : 'development'
),
}),
new ExtractTextPlugin('[name]-[contenthash].css'),
new HtmlWebpackPlugin({
title: 'Slate',
Expand Down

0 comments on commit 001460f

Please sign in to comment.