<commit_before>var path = require("path");
var webpack = require("webpack");
var AssetsPlugin = require('assets-webpack-plugin');
var WebpackMd5Hash = require('webpack-md5-hash');

// Ensure a WEBPACK_HOST is setup since we embed it in the assets.json file
if(!process.env.WEBPACK_HOST) {
  throw "No WEBPACK_HOST set";
}

// The WEBPACK_HOST must end with a /
if(process.env.WEBPACK_HOST.slice(-1) != "/") {
  throw "WEBPACK_HOST must end with a /";
}

// Include a hash of the bundle in the name when we're building these files for
// production so we can use non-expiring caches for them.
//
// Also, if we used hashes in development, we'd be forever filling up our dist
// folder with every hashed version of files we've changed (webpack doesn't
// clean up after itself)
var filenameFormat
var chunkFilename
if(process.env.NODE_ENV == "production") {
  filenameFormat = "[name]-[chunkhash].js"
  chunkFilename = "[id]-[chunkhash].js"
} else {
  filenameFormat = "[name].js"
  chunkFilename = "[id].js"
}

// Toggle between the devtool if on prod/dev since cheap-module-eval-source-map
// is way faster for development.
var devTool
if(process.env.NODE_ENV == "production") {
  devTool = "source-map"
} else {
  devTool = "cheap-module-eval-source-map"
}

var plugins = [
  new WebpackMd5Hash(),
  new webpack.ProvidePlugin({ 'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch' }),
  new webpack.optimize.CommonsChunkPlugin({ names: [ "emojis", "vendor", "manifest" ] }),
  new AssetsPlugin({ path: path.join(__dirname, '..', 'dist'), filename: 'assets.json' }),
  new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /en/)
]

// If we're building for production, minify the JS
if(process.env.NODE_ENV == "production") {
  // Need this plugin to ensure consistent module ordering so we can have determenistic filename hashes
  plugins.push(new webpack.optimize.OccurenceOrderPlugin(true));
  plugins.push(new webpack.optimize.DedupePlugin());
  plugins.push(new webpack.optimize.UglifyJsPlugin({
    output: {
      comments: false
    },
    compress: {
      warnings: false,
      screw_ie8: true
    }
  }));<commit_msg>Revert "Only include the en webpack local (saves 200kb in vendor)"<commit_after>var path = require("path");
var webpack = require("webpack");
var AssetsPlugin = require('assets-webpack-plugin');
var WebpackMd5Hash = require('webpack-md5-hash');

// Ensure a WEBPACK_HOST is setup since we embed it in the assets.json file
if(!process.env.WEBPACK_HOST) {
  throw "No WEBPACK_HOST set";
}

// The WEBPACK_HOST must end with a /
if(process.env.WEBPACK_HOST.slice(-1) != "/") {
  throw "WEBPACK_HOST must end with a /";
}

// Include a hash of the bundle in the name when we're building these files for
// production so we can use non-expiring caches for them.
//
// Also, if we used hashes in development, we'd be forever filling up our dist
// folder with every hashed version of files we've changed (webpack doesn't
// clean up after itself)
var filenameFormat
var chunkFilename
if(process.env.NODE_ENV == "production") {
  filenameFormat = "[name]-[chunkhash].js"
  chunkFilename = "[id]-[chunkhash].js"
} else {
  filenameFormat = "[name].js"
  chunkFilename = "[id].js"
}

// Toggle between the devtool if on prod/dev since cheap-module-eval-source-map
// is way faster for development.
var devTool
if(process.env.NODE_ENV == "production") {
  devTool = "source-map"
} else {
  devTool = "cheap-module-eval-source-map"
}

var plugins = [
  new WebpackMd5Hash(),
  new webpack.ProvidePlugin({ 'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch' }),
  new webpack.optimize.CommonsChunkPlugin({ names: [ "emojis", "vendor", "manifest" ] }),
  new AssetsPlugin({ path: path.join(__dirname, '..', 'dist'), filename: 'assets.json' })
]

// If we're building for production, minify the JS
if(process.env.NODE_ENV == "production") {
  // Need this plugin to ensure consistent module ordering so we can have determenistic filename hashes
  plugins.push(new webpack.optimize.OccurenceOrderPlugin(true));
  plugins.push(new webpack.optimize.DedupePlugin());
  plugins.push(new webpack.optimize.UglifyJsPlugin({
    output: {
      comments: false
    },
    compress: {
      warnings: false,
      screw_ie8: true
    }
  }));
{'fraction_non_alphanumeric': 0.13504672897196263, 'fraction_numerical': 0.0030373831775700934, 'mean_word_length': 4.139255702280912, 'pattern_counts': {'":': 0, '<': 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': '2438594', 'n_tokens_mistral': 1358, 'n_tokens_neox': 1364, 'n_words': 401}