/* eslint-disable */

const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');

let definePlugin;
const secretConfig = require('./src/config/secret.config.json');

if (process.env.NODE && ~process.env.NODE.indexOf('heroku')) {
  definePlugin = new webpack.DefinePlugin(Object.assign(require('./src/config/heroku.config.json'), secretConfig));
} else {
  definePlugin = new webpack.DefinePlugin(Object.assign(require('./src/config/sccloud.config.json'), secretConfig));
}

const config = {
  entry: {
    main: [
      './src/client/index.jsx',
    ],
    vendor: [
      'auth0-lock',
      'jwt-decode',
      'react',
      'react-dom',
      'react-hot-loader',
      'react-intl',
      'react-redux',
      'react-router',
      'react-tap-event-plugin',
      'redux',
    ]
  },

  output: {
    path: path.join(__dirname, 'dist/'),
    filename: '[hash].[name].js',
  },

  module: {
    rules: [
      {
        test: /\.(js|jsx)$/,
        exclude: /node_modules/,
        loader: 'babel-loader',
        options: {
          presets: [
            [
              'es2015',
              {
                'modules': false
              }
            ],
            'react'
          ],
          plugins: [
            'transform-flow-strip-types',
            'transform-runtime',
            'transform-react-jsx',
            'transform-react-inline-elements',
            'transform-react-constant-elements',
            'transform-react-remove-prop-types',
            [
              'react-intl',
              {
                'messagesDir': './dist/messages',
                'enforceDescriptions': false
              }
            ]
          ],
        },
      },
    ],
  },

  plugins: [
    new HtmlWebpackPlugin({
      template: 'src/client/index.html',
    }),
    new CopyWebpackPlugin([
      {
        from: 'src/client/assets/',
        to: 'assets/',
      }
    ]),
    new webpack.optimize.CommonsChunkPlugin({
      name: 'vendor',
    }),
    definePlugin,
  ],
};


module.exports = config;
@@ -219,73 +219,8 @@
 gin;
-%0Aconst secretConfig = require('./src/config/secret.config.json');
 %0A%0Aif
@@ -318,38 +318,24 @@
 efinePlugin(
-Object.assign(
 require('./s
@@ -360,39 +360,24 @@
 onfig.json')
-, secretConfig)
 );%0A%7D else %7B%0A
@@ -422,22 +422,8 @@
 gin(
-Object.assign(
 requ
@@ -465,23 +465,8 @@
 on')
-, secretConfig)
 );%0A%7D

remove unnecessary secret import for prod