title: How to put React in production mode?
body: <p>I tried using the solution from <a href="https://stackoverflow.com/questions/22118915/how-to-turn-on-off-reactjs-development-mode">here</a> but the icon is still read indicating dev mode.</p>
  
  <p>Here is my current file with updates from the answer below:</p>
  
  <pre><code>const path = require('path');
  const SRC_DIR = path.join(__dirname, '/client-react/src');
  const DIST_DIR = path.join(__dirname, '/client-react/dist');
  const webpack = require('webpack')
  
  module.exports = {
    entry: `${SRC_DIR}/index.jsx`,
    output: {
      filename: 'bundle.js',
      path: DIST_DIR
    },
    plugins: [
      new webpack.DefinePlugin({'process.env': {NODE_ENV: JSON.stringify('production')} })
    ],
    module: {
        loaders: [
        {
          test: /\.jsx?/,
          include: SRC_DIR,
          loader: 'babel-loader',
          query: {
            plugins: ["transform-object-rest-spread", "transform-class-properties"],
            presets: ['react', 'es2015']
         }
        }
      ]
    }
  };
  </code></pre>