<commit_before>const base = require('./base.js');
const _ = require('lodash');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const postcssImport = require('postcss-import');
const cssnext = require('postcss-cssnext');
const postcssReporter = require("postcss-reporter");

const config = _.merge({}, base);

config.output = _.merge(config.output, {
  filename: '[name]_bundle-[chunkhash].js'
});

config.plugins.push(
  new webpack.optimize.UglifyJsPlugin(),
  new webpack.optimize.CommonsChunkPlugin('application', 'application_bundle-[hash].js'),
  new webpack.optimize.OccurenceOrderPlugin(),
  new ExtractTextPlugin('[name]_bundle-[hash].css', {
    allChunks: true
  }),
  new webpack.DefinePlugin({
    'process.env': {
       NODE_ENV: JSON.stringify('production')
     }
  })
);

config.postcss = function(webpack) {
  return [
    postcssImport({addDependencyTo: webpack}),
    cssnext({autoprefixer: {browsers: "ie >= 9, ..."}}),
    postcssReporter({clearMessages: true})
  ]<commit_msg>optimize<commit_after>const base = require('./base.js');
const _ = require('lodash');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const postcssImport = require('postcss-import');
const cssnext = require('postcss-cssnext');
const postcssReporter = require("postcss-reporter");

const config = _.merge(base, {
  devtool: 'cheap-module-source-map'
});

config.output = _.merge(config.output, {
  filename: '[name]_bundle-[chunkhash].js'
});

config.plugins.push(
  new webpack.DefinePlugin({
    'process.env': {
       NODE_ENV: JSON.stringify('production')
     }
  }),
  new webpack.optimize.CommonsChunkPlugin('application', 'application_bundle-[hash].js'),
  new webpack.optimize.UglifyJsPlugin({
    compress: {
      warnings: false
    }
  }),
  new webpack.optimize.MinChunkSizePlugin({
    compress: {
      warnings: false
    }
  }),
  // new webpack.optimize.DedupePlugin(),
  new webpack.optimize.OccurenceOrderPlugin(),
  new webpack.optimize.AggressiveMergingPlugin({
      minSizeReduce: 1.5,
      moveToParents: true
  }),
  new ExtractTextPlugin('[name]_bundle-[hash].css', {
    allChunks: true
  })
);

config.postcss = function(webpack) {
  return [
    postcssImport({addDependencyTo: webpack}),
    cssnext({autoprefixer: {browsers: "ie >= 9, ..."}}),
    postcssReporter({clearMessages: true})
  ]
{'fraction_non_alphanumeric': 0.16248457424928014, 'fraction_numerical': 0.0016454134101192926, 'mean_word_length': 4.62962962962963, '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': '7220745', 'n_tokens_mistral': 798, 'n_tokens_neox': 774, 'n_words': 129}