title: Can't Set NODE_ENV to production with webpack
body: <p>I'm using webpack 2.2.1 to build a react-redux app for production, but can't seem to set <code>process.env.NODE_ENV</code> to <code>production</code>.</p>
  
  <p>Here is webpack.config.js:</p>
  
  <pre><code>var webpack = require('webpack');
  var path = require('path');
  var ExtractTextPlugin = require("extract-text-webpack-plugin");
  var HtmlWebpackPlugin = require('html-webpack-plugin');
  
  const VENDOR_LIBS = [
    'axios', 'lodash', 'react', 'react-dom', 'react-redux',
    'react-router', 'redux', 'redux-form', 'redux-thunk'
  ];
  
  module.exports = {
    entry: {
      bundle: './src/index.js',
      vendor: VENDOR_LIBS
    },
    output: {
      path: path.resolve(__dirname, 'dist'),
      filename: '[name].[chunkhash].js'
    },
    module: {
      rules: [
        {
          use: 'babel-loader',
          test: /\.js$/,
          exclude: /node_modules/,
        },
        {
          test: /\.css$/,
          use: ExtractTextPlugin.extract({
            fallback: "style-loader",
            use: "css-loader"
          })
        }
      ]
    },
    plugins: [
      new ExtractTextPlugin('style.css'),
      new webpack.optimize.CommonsChunkPlugin({
        names: ['vendor', 'manifest']
      }),
      new HtmlWebpackPlugin({
        template: 'src/index.html'
      }),
      new webpack.DefinePlugin({
        'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
      })
    ],
    devServer: {
      historyApiFallback: true,
      contentBase: './'
    }
  };
  </code></pre>
  
  <p>And here are my scripts in package.json:</p>
  
  <pre><code>"scripts": {
     "clean": "rimraf dist",
      "build": "NODE_ENV=production npm run clean &amp;&amp; webpack -p",
      "serve": "webpack-dev-server"
  }
  </code></pre>
  
  <p>When I run <code>npm run build</code>, my bundle.js is compiled but it's not for production. In my webpack.config.js, I replaced the option for the DefinePlugin to <code>'process.env.NODE_ENV': '"production"'</code> and it worked. So I'm thinking there is something wrong with my package.json file, but I can't figure out what it is.</p>