<commit_before>const webpack = require('webpack');
const autoprefixer = require('autoprefixer');
const cssnano = require('cssnano');

const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const UglifyWebpackPlugin = require('uglifyjs-webpack-plugin');
const CompressionPlugin = require('compression-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');

const postCSSLoader = {
	loader: 'postcss-loader',
	options: {
		plugins: () => ([autoprefixer]),
	},
};

exports.devServer = ({ host, port } = {}) => ({
	devServer: {
		historyApiFallback: true,
		stats: 'errors-only',
		host,
		port,
		headers: {
			'Access-Control-Allow-Origin': '*',
			'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept'
		},
		overlay: {
			errors: true,
			warnings: true,
		},
	},
});

exports.loadJS = ({ include, exclude } = {}) => ({
	module: {
		rules: [
			{
				test: /\.js$/,
				include,
				exclude,
				loader: 'babel-loader',
			},
		],
	},
});

exports.loadCSS = ({ include, exclude } = {}) => ({
	module: {
		rules: [
			{
				test: /\.s?css$/,
				include,
				exclude,
				use: [
					'style-loader',
					'css-loader',
					postCSSLoader,
					'sass-loader',
				],
			},
			{
				test: /\.less$/,
				include,
				exclude,
				use: [
					'style-loader',
					'css-loader',
					postCSSLoader,
					'less-loader',
				],
			},
		],
	}
});

exports.extractCSS = ({ include, exclude, filename } = {}) => ({
	module: {
		rules: [
			{
				test: /\.s?css$/,
				include,
				exclude,
				use: [
					MiniCssExtractPlugin.loader,
					'css-loader',
					'sass-loader',
				],
			},
			{
				test: /\.less$/,
				include,
				exclude,
				use: [
					MiniCssExtractPlugin.loader,
					'css-loader',
					'less-loader',
				],
			},
		],
	},
	plugins: [
		new MiniCssExtractPlugin({<commit_msg>Add autoprefixed to prod bundle<commit_after>const webpack = require('webpack');
const autoprefixer = require('autoprefixer');
const cssnano = require('cssnano');

const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const UglifyWebpackPlugin = require('uglifyjs-webpack-plugin');
const CompressionPlugin = require('compression-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');

const postCSSLoader = {
	loader: 'postcss-loader',
	options: {
		plugins: () => ([autoprefixer]),
	},
};

exports.devServer = ({ host, port } = {}) => ({
	devServer: {
		historyApiFallback: true,
		stats: 'errors-only',
		host,
		port,
		headers: {
			'Access-Control-Allow-Origin': '*',
			'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept'
		},
		overlay: {
			errors: true,
			warnings: true,
		},
	},
});

exports.loadJS = ({ include, exclude } = {}) => ({
	module: {
		rules: [
			{
				test: /\.js$/,
				include,
				exclude,
				loader: 'babel-loader',
			},
		],
	},
});

exports.loadCSS = ({ include, exclude } = {}) => ({
	module: {
		rules: [
			{
				test: /\.s?css$/,
				include,
				exclude,
				use: [
					'style-loader',
					'css-loader',
					postCSSLoader,
					'sass-loader',
				],
			},
			{
				test: /\.less$/,
				include,
				exclude,
				use: [
					'style-loader',
					'css-loader',
					postCSSLoader,
					'less-loader',
				],
			},
		],
	}
});

exports.extractCSS = ({ include, exclude, filename } = {}) => ({
	module: {
		rules: [
			{
				test: /\.s?css$/,
				include,
				exclude,
				use: [
					MiniCssExtractPlugin.loader,
					'css-loader',
					postCSSLoader,
					'sass-loader',
				],
			},
			{
				test: /\.less$/,
				include,
				exclude,
				use: [
					MiniCssExtractPlugin.loader,
					'css-loader',
					postCSSLoader,
					'less-loader',
				],
			},
		],
	},
	plugins: [
		new MiniCssExtractPlugin({
{'fraction_non_alphanumeric': 0.18231495280675608, 'fraction_numerical': 0.0, 'mean_word_length': 2.8098391674550616, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '1152993', 'n_tokens_mistral': 1784, 'n_tokens_neox': 1421, 'n_words': 235}