'use strict';

const webpack = require('webpack');
const path = require('path');
const buildPath = path.join(__dirname, './dist');
const args = require('yargs').argv;

const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');

var isProd = args.prod;
var isDev = args.dev;

var entry = ['./src/site.js'];
var devtool;

if (isDev) {
    entry.push('webpack-dev-server/client?http://0.0.0.0:8080');
    devtool = 'source-map';
}

var plugins = [
    new ExtractTextPlugin('[name].[hash].css'),
    new HtmlWebpackPlugin({
        template: './src/index.html',
        inject: 'body',
        chunks: 'app'
    })
];

if (isProd) {
    plugins.push(
        new webpack.NoErrorsPlugin(),
        new webpack.optimize.DedupePlugin(),
        new webpack.optimize.UglifyJsPlugin({
            compress: {
                warnings: false
            },
            mangle: true
        }),
        new webpack.optimize.OccurenceOrderPlugin()
    );
}

module.exports = {
    entry: entry,

    output: {
        path: buildPath,
        publicPath: '/',
        filename: '[name].[hash].js'
    },

    module: {
        loaders: [
            { test: /\.json$/, loader: 'json'},
            { test: /\.js$/, exclude: /node_modules/, loader: 'babel'},
            { test: /\.scss$/, exclude: /node_modules/, loader: ExtractTextPlugin.extract('style', 'css?sourceMap!sass') },
            { test: /\.png$/, exclude: /node_modules/, loader: 'file-loader?name=images/[name].[ext]' }
        ]
    },

    quiet: false,
    noInfo: false,

    plugins: plugins,

    devtool: devtool,

    devServer: {
        contentBase: buildPath,
        host: '0.0.0.0',
        port: 8080
    }
};


@@ -286,19 +286,19 @@
 gin');%0A%0A
-var
+let
  isProd 
@@ -310,19 +310,19 @@
 s.prod;%0A
-var
+let
  isDev =
@@ -333,19 +333,19 @@
 s.dev;%0A%0A
-var
+let
  entry =
@@ -364,19 +364,19 @@
 e.js'%5D;%0A
-var
+let
  devtool
@@ -491,11 +491,11 @@
 %0A%7D%0A%0A
-var
+let
  plu

Revert "Raji/Sneha Fix 'strict' errors"