<commit_before>'use strict';
//-----------------------------------
// Webpack Config
// - http://stackoverflow.com/questions/31903692/how-can-i-use-es6-in-webpack-config-js
//-----------------------------------
import path from 'path';
import webpack from 'webpack';
// import DashboardPlugin = from 'webpack-dashboard/plugin';

const PORT = process.env.PORT || 3000;

let wpConfigBase = {

  target:'web',
  cache: true,
  context: path.join(__dirname, 'src/js'),

  entry: {
    app: './main.js',
    vendor: [
      'react',
      'react-dom',
      'react-router',
      'lodash',
      "moment",
      "moment-duration-format",
      "speakingurl"
    ]
  },

  output: {
    path: path.resolve(__dirname, 'public/js'),
    filename: '[name].bundle.js',
    chunkFilename: '[name].chunk.js'
  },

  module: {
    rules: [
      {
        test: /\.jsx?$/, // it can also be written as -> test: /\.(js|jsx)$/,
        include: path.resolve(__dirname, 'src/js/'),
        exclude: /node_modules/,
        loader: 'babel-loader',
        options: {
          cacheDirectory: true,
          presets: [
            ["es2015", { "modules": false }],
            "react"
          ]
        }
      }
    ]
  },

  plugins: [
    new webpack.HashedModuleIdsPlugin(),

    new webpack.optimize.CommonsChunkPlugin({
      name: 'vendor'
    }),

    // new DashboardPlugin({ port: 9001 }),

    new webpack.NoEmitOnErrorsPlugin()
  ],

  profile: true,

  stats: {
    colors: true,
    modules: false
  },

  // devtool options for development: eval | cheap-eval-source-map | cheap-module-eval-source-map
  devtool: 'eval', // Enabled in Dev environment

  devServer: {
    contentBase: path.join(__dirname, 'public'),
    compress: true,
    port: PORT
  }
};




// Extends webpack config: It Adds aditional Plugins for Production Builds only
//--------------
export default function(env) {

  if ( env && env.prod === 'true' ) {

    wpConfigBase.devtool = 'source-map';

    wpConfigBase.plugins.push(<commit_msg>Update webpack devtool settings for development and Prod.<commit_after>'use strict';
//-----------------------------------
// Webpack Config
// - http://stackoverflow.com/questions/31903692/how-can-i-use-es6-in-webpack-config-js
//-----------------------------------
import path from 'path';
import webpack from 'webpack';
// import DashboardPlugin = from 'webpack-dashboard/plugin';

const PORT = process.env.PORT || 3000;

let wpConfigBase = {

  // devtool options for development: eval | cheap-eval-source-map | cheap-module-eval-source-map
  devtool: 'cheap-eval-source-map', // Enabled in Dev environment

  target:'web',
  cache: true,
  context: path.join(__dirname, 'src/js'),

  entry: {
    app: './main.js',
    vendor: [
      'react',
      'react-dom',
      'react-router',
      'lodash',
      "moment",
      "moment-duration-format",
      "speakingurl"
    ]
  },

  output: {
    path: path.resolve(__dirname, 'public/js'),
    filename: '[name].bundle.js',
    chunkFilename: '[name].chunk.js'
  },

  module: {
    rules: [
      {
        test: /\.jsx?$/, // it can also be written as -> test: /\.(js|jsx)$/,
        include: path.resolve(__dirname, 'src/js/'),
        exclude: /node_modules/,
        loader: 'babel-loader',
        options: {
          cacheDirectory: true,
          presets: [
            ["es2015", { "modules": false }],
            "react"
          ]
        }
      }
    ]
  },

  plugins: [
    new webpack.HashedModuleIdsPlugin(),

    new webpack.optimize.CommonsChunkPlugin({
      name: 'vendor'
    }),

    // new DashboardPlugin({ port: 9001 }),

    new webpack.NoEmitOnErrorsPlugin()
  ],

  profile: true,

  stats: {
    colors: true,
    modules: false
  },

  devServer: {
    contentBase: path.join(__dirname, 'public'),
    compress: true,
    port: PORT
  }

};




// Extends webpack config: It Adds aditional Plugins for Production Builds only
//--------------
export default function(env) {

  if ( env && env.prod === 'true' ) {

    wpConfigBase.devtool = 'cheap-module-source-map'; // 'source-map';

    wpConfigBase.plugins.push(
{'fraction_non_alphanumeric': 0.1912621359223301, 'fraction_numerical': 0.010194174757281554, 'mean_word_length': 2.0616641901931647, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6683954', 'n_tokens_mistral': 1348, 'n_tokens_neox': 1276, 'n_words': 281}