try fixing react warnings again
This commit is contained in:
parent
bdac00bc10
commit
fae69133be
1 changed files with 16 additions and 7 deletions
|
@ -1,13 +1,22 @@
|
||||||
const path = 'path'
|
const path = require('path')
|
||||||
const webpack = 'webpack'
|
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 = {
|
const config = module.exports = {
|
||||||
context: __dirname,
|
context: __dirname,
|
||||||
plugins: [
|
plugins,
|
||||||
new webpack.DefinePlugin({
|
|
||||||
"process.env.NODE_ENV": `"${process.env.NODE_ENV || 'development'}"`
|
|
||||||
})
|
|
||||||
],
|
|
||||||
module: {
|
module: {
|
||||||
loaders: [
|
loaders: [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue