Merge pull request #2416 from resin-io/enable-production-react

chore(webpack): Set NODE_ENV to production for React / WebPack
This commit is contained in:
Jonas Hermsmeier 2018-07-10 17:08:12 +02:00 committed by GitHub
commit 1fb420c2fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,6 +16,7 @@
'use strict'
const webpack = require('webpack')
const path = require('path')
const SimpleProgressWebpackPlugin = require('simple-progress-webpack-plugin')
const nodeExternals = require('webpack-node-externals')
@ -89,6 +90,9 @@ module.exports = {
plugins: [
new SimpleProgressWebpackPlugin({
format: process.env.WEBPACK_PROGRESS || 'verbose'
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'production')
})
]
}