try fixing react warnings again

This commit is contained in:
Devin Howard 2016-08-11 11:42:35 +08:00
parent bdac00bc10
commit fae69133be

View file

@ -1,13 +1,22 @@
const path = 'path'
const webpack = 'webpack'
const path = require('path')
const webpack = require('webpack')
const NODE_ENV = process.env.NODE_ENV || 'development'
const plugins = [
new webpack.DefinePlugin({
"process.env.NODE_ENV": `"${NODE_ENV}"`
})
]
if (NODE_ENV === 'production') {
plugins.push(new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false }
}))
}
const config = module.exports = {
context: __dirname,
plugins: [
new webpack.DefinePlugin({
"process.env.NODE_ENV": `"${process.env.NODE_ENV || 'development'}"`
})
],
plugins,
module: {
loaders: [
{