<commit_before>const webpack       = require('webpack');
const autoprefixer  = require('autoprefixer');
const ExtractPlugin = require('extract-text-webpack-plugin');
const CleanPlugin   = require('clean-webpack-plugin');

// set by the npm script that was run
const production    = process.env.NODE_ENV === 'production' || process.npm_lifecycle_event === 'build:production';

// set in the .npmrc file
const API_URL       = production ? process.env.npm_config_production_url : process.env.npm_config_dev_url;

const PATHS = {
  entry: `${__dirname}/app/entry`, 
  build: `${__dirname}/build`
};

let plugins = [
  new ExtractPlugin('bundle.css'),
  new webpack.optimize.CommonsChunkPlugin({
    name:       'vendor', 
    children:   true,
    minChunks:  2
  }),
  new webpack.optimize.OccurenceOrderPlugin(),
  new webpack.DefinePlugin({
    // Deployment url of the backend or localhost for testing
    __API_URL__:            JSON.stringify(API_URL), 
    
    // Controls whether console logs and other dev features take place
    // TODO: switch from boolean to regex? Not sure if webpack smart enough for that
    __DEVONLY__:            !production, 
    
    // The name of the cookie to attach as X-`${__COOKIE_NAME__}` as a header for authentication
    __COOKIE_NAME__:        JSON.stringify(process.env.npm_config_auth_cookie_name), 
    
    // The break point from mobile to fullscreen, currently defined as 992 px, the bootstrap md breakpoint
    __MOBILE_BREAK_POINT__: process.env.npm_config_mobile_break_point
  })
];

if (production) {
  plugins.push(new CleanPlugin('build'));
}


if (production) {
  plugins = plugins.concat([
    new webpack.optimize.UglifyJsPlugin({
      mangle:   true, 
      compress: {
        warnings: false
      }
    })
  ]);
}

module.exports = {
  debug:  !production, 
  entry:  {
    bundle:     [
      'bootstrap-loader/extractStyles', 
      PATHS.entry
    ],
    <commit_msg>fixed placement of clean plugin in webpack.config<commit_after>const webpack       = require('webpack');
const autoprefixer  = require('autoprefixer');
const ExtractPlugin = require('extract-text-webpack-plugin');
const CleanPlugin   = require('clean-webpack-plugin');

// set by the npm script that was run
const production    = process.env.NODE_ENV === 'production' || process.npm_lifecycle_event === 'build:production';

// set in the .npmrc file
const API_URL       = production ? process.env.npm_config_production_url : process.env.npm_config_dev_url;

const PATHS = {
  entry: `${__dirname}/app/entry`, 
  build: `${__dirname}/build`
};

let plugins = [
  new ExtractPlugin('bundle.css'),
  new webpack.optimize.CommonsChunkPlugin({
    name:       'vendor', 
    children:   true,
    minChunks:  2
  }),
  new webpack.optimize.OccurenceOrderPlugin(),
  new webpack.DefinePlugin({
    // Deployment url of the backend or localhost for testing
    __API_URL__:            JSON.stringify(API_URL), 
    
    // Controls whether console logs and other dev features take place
    // TODO: switch from boolean to regex? Not sure if webpack smart enough for that
    __DEVONLY__:            !production, 
    
    // The name of the cookie to attach as X-`${__COOKIE_NAME__}` as a header for authentication
    __COOKIE_NAME__:        JSON.stringify(process.env.npm_config_auth_cookie_name), 
    
    // The break point from mobile to fullscreen, currently defined as 992 px, the bootstrap md breakpoint
    __MOBILE_BREAK_POINT__: process.env.npm_config_mobile_break_point
  })
];

if (production) {
  plugins = plugins.concat([
    new webpack.optimize.UglifyJsPlugin({
      mangle:   true, 
      compress: {
        warnings: false
      }
    }), 
    new CleanPlugin('build')
  ]);
}

module.exports = {
  debug:  !production, 
  entry:  {
    bundle:     [
      'bootstrap-loader/extractStyles', 
      PATHS.entry
    ],
    
{'fraction_non_alphanumeric': 0.10586108959462949, 'fraction_numerical': 0.0020655822359927703, 'mean_word_length': 3.112526539278132, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2311044', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1168, 'n_words': 306}