const path = require('path');
const webpack = require('webpack');

module.exports = {
  entry: [
    'babel-polyfill',
    './app/index'
  ],
  output: {
    path: path.resolve(__dirname, 'public/assets/javascript'),
    filename: 'index.js',
    publicPath: 'public/assets/javascript/'
  },
  plugins: [
    new webpack.optimize.OccurenceOrderPlugin(),
    new webpack.optimize.UglifyJsPlugin()
  ],
  module: {
    loaders: [
      {
        loader: 'babel-loader',
        include: [
          path.resolve(__dirname, 'app'),
        ],
        exclude: /node_modules/,
        test: /\.js/,
        query: {
          plugins: ['transform-runtime'],
          presets: ['es2015', 'react']
        }
      }
    ]
  }
};
const path = require('path');
const webpack = require('webpack');

module.exports = {
  entry: [
    'babel-polyfill',
    './app/index'
  ],
  output: {
    path: path.resolve(__dirname, 'public/assets/javascript'),
    filename: 'index.js',
    publicPath: 'public/assets/javascript/'
  },
  plugins: [
    new webpack.optimize.OccurenceOrderPlugin(),
    new webpack.DefinePlugin({
      'process.env': {
        NODE_ENV: JSON.stringify('production')
      }
    }),
    new webpack.optimize.UglifyJsPlugin()
  ],
  module: {
    loaders: [
      {
        loader: 'babel-loader',
        include: [
          path.resolve(__dirname, 'app'),
        ],
        exclude: /node_modules/,
        test: /\.js/,
        query: {
          plugins: ['transform-runtime'],
          presets: ['es2015', 'react']
        }
      }
    ]
  }
};

Refactor webpack production config to minify reactjs.