<commit_before>var path = require('path');
var webpack = require('webpack');
var build = require('webpack-build');
var autoprefixer = require('autoprefixer-core');
var ExtractTextPlugin = require('extract-text-webpack-plugin');

module.exports = function(opts) {
	var config = {
		context: __dirname,
		entry: './app',
		output: {
			filename: '[name]-[hash].js'
		},
		module: {
			loaders: [
				{
					test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
					loader: "url-loader?limit=10000&mimetype=application/font-woff"
				},
				{
					test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
					loader: "file-loader"
				}
			]
		},
		postcss: [autoprefixer],
		plugins: [
			new webpack.optimize.OccurrenceOrderPlugin(),
			new webpack.NoErrorsPlugin()
		]
	};

	if (opts.hmr && !opts.context.DEBUG) {
		// Enable hmr of react components and stylesheets
		config.module.loaders.push(
			{
				test: /\.jsx?$/,
				exclude: /(node_modules|bower_components)/,
				loader: 'react-hot-loader!babel-loader'
			},
			{
				test: /\.css$/,
				loader: 'style!css?sourceMap!postcss'
			}
		);
	} else {
		config.module.loaders.push(
			{
				test: /\.jsx?$/,
				exclude: /(node_modules|bower_components)/,
				loader: 'babel-loader'
			},
			// Move css assets into separate files
			{
				test: /\.css$/,
				loader: ExtractTextPlugin.extract('style', 'css?sourceMap!postcss')
			}
		);

		config.plugins.push(
			new ExtractTextPlugin('[name]-[contenthash].css')
		);
	}

	if (opts.context.DEBUG) {
		config.devtool = 'inline-source-map';

		config.output.pathinfo = true;

		config.plugins.push(
			new webpack.DefinePlugin({
				'process.env': {
					NODE_ENV: JSON.stringify('development')
				}
			})
		);
	} else {
		config.devtool = 'source-map';

		config.plugins.push(
			new webpack.optimize.DedupePlugin(),
			new webpack.DefinePlugin({
				'process.env': {
					NODE_ENV: JSON.stringify('production')
				}
			})
		);
	}

	return config;
};<commit_msg>Cleaned up the example webpack config.<commit_after>var path = require('path');
var webpack = require('webpack');
var build = require('webpack-build');
var autoprefixer = require('autoprefixer-core');
var ExtractTextPlugin = require('extract-text-webpack-plugin');

module.exports = function(opts) {
	var jsLoader = {
		test: /\.jsx?$/,
		exclude: /(node_modules|bower_components)/,
		loaders: ['babel-loader']
	};

	var cssLoader = {
		test: /\.css$/,
		loaders: ['css-loader?sourceMap', 'postcss-loader']
	};

	var config = {
		context: __dirname,
		entry: './app',
		output: {
			filename: '[name]-[hash].js'
		},
		module: {
			loaders: [
				jsLoader,
				cssLoader,
				{
					test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
					loaders: ['url-loader?limit=10000&mimetype=application/font-woff']
				},
				{
					test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
					loaders: ['file-loader']
				}
			]
		},
		postcss: [autoprefixer],
		plugins: [
			new webpack.optimize.OccurrenceOrderPlugin(),
			new webpack.NoErrorsPlugin()
		]
	};

	if (opts.hmr) {
		// Enable hmr of react components and stylesheets
		jsLoader.loaders.unshift('react-hot-loader');
		cssLoader.loaders.unshift('style');
	} else {
		// Move css assets into separate files
		cssLoader.loader = ExtractTextPlugin.extract('style', cssLoader.loaders.join('!'));
		delete cssLoader.loaders;
		config.plugins.push(new ExtractTextPlugin('[name]-[contenthash].css'));
	}

	if (opts.context.DEBUG) {
		config.devtool = 'eval-source-map';
		config.output.pathinfo = true;
		config.plugins.push(
			new webpack.DefinePlugin({
				'process.env': {
					NODE_ENV: JSON.stringify('development')
				}
			})
		);
	} else {
		config.devtool = 'source-map';
		config.plugins.push(
			new webpack.optimize.DedupePlugin(),
			new webpack.DefinePlugin({
				'process.env': {
					NODE_ENV: JSON.stringify('production')
				}
			}),
			new webpack.UglifyJsPlugin()
		);
	}

	return config;
};
{'fraction_non_alphanumeric': 0.18732430360337338, 'fraction_numerical': 0.009200102223358037, 'mean_word_length': 3.1727078891257996, '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': '635542', 'n_tokens_mistral': 1722, 'n_tokens_neox': 1426, 'n_words': 228}