<commit_before>const path = require('path');
const validate = require('webpack-validator');
const webpack = require('webpack');

const isProd = (process.env.NODE_ENV === 'production');

function getPlugins() {
  const plugins = [
    new webpack.DefinePlugin({
      'process.env': {
        NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'development')
      }
    })
  ];
  if (isProd) {
    plugins.push(new webpack.optimize.UglifyJsPlugin({
      compress: {warnings: false}
      // TODO: Mangling reduces bundle size by 20%, but breaks things.
      // Need to figure out the right set of exceptions.
      // mangle: {props: true}
    }));
    plugins.push(new webpack.optimize.DedupePlugin());
    plugins.push(new webpack.optimize.AggressiveMergingPlugin());
  }
  return plugins;
}

module.exports = validate({
  devtool: isProd ? 'source-map' : 'eval-source-map',
  entry: {
    other: './other.js'
  },
  module: {
    loaders: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loaders: ['babel']
      }
    ]
  },
  output: {
    filename: './other.min.js',
    library: '[name]',
    libraryTarget: 'commonjs2',
    path: path.resolve(__dirname, 'dist'),
    sourceMapFilename: "./[name].js.map"
  },
  plugins: getPlugins()
});<commit_msg>Attempt a different library method<commit_after>const path = require('path');
const validate = require('webpack-validator');
const webpack = require('webpack');

const isProd = (process.env.NODE_ENV === 'production');

function getPlugins() {
  const plugins = [
    new webpack.DefinePlugin({
      'process.env': {
        NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'development')
      }
    })
  ];
  if (isProd) {
    plugins.push(new webpack.optimize.UglifyJsPlugin({
      compress: {warnings: false}
      // TODO: Mangling reduces bundle size by 20%, but breaks things.
      // Need to figure out the right set of exceptions.
      // mangle: {props: true}
    }));
    plugins.push(new webpack.optimize.DedupePlugin());
    plugins.push(new webpack.optimize.AggressiveMergingPlugin());
  }
  return plugins;
}

module.exports = validate({
  devtool: isProd ? 'source-map' : 'eval-source-map',
  entry: {
    other: './other.js'
  },
  module: {
    loaders: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loaders: ['babel']
      }
    ]
  },
  output: {
    filename: './other.min.js',
    libraryTarget: 'commonjs2',
    path: path.resolve(__dirname, 'dist'),
    sourceMapFilename: "./[name].js.map"
  },
  plugins: getPlugins()
});
{'fraction_non_alphanumeric': 0.159375, 'fraction_numerical': 0.00234375, 'mean_word_length': 2.8395802098950527, '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': '4073751', 'n_tokens_mistral': 844, 'n_tokens_neox': 828, 'n_words': 180}