<commit_before>'use strict';

var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var fs = require('fs');
var _ = require('lodash');

module.exports = function(pkg, overrides) {
    overrides = overrides || {};

    // Read environment from current NODE_ENV
    var environment = process.env.NODE_ENV || 'development';

    // Default settings
    var defaultConfig = {
        output: 'dist/',
        bundles: { /* see below */ },
        autoprefixer: ['last 4 versions', 'Firefox ESR', 'Opera 12.1'],
    };

    // If package has a name, use that as default input/output bundle
    if(pkg.name) {
        defaultConfig.bundles[pkg.name] = ['./src/' + pkg.name + '.js'];
    }

    if(process.env.NODE_ENV !== 'production') {
        _.map(defaultConfig.bundles, function(source) {
            source.push('webpack-dev-server/client?http://0.0.0.0:8080');
        })
    }

    // Override defaults where necessary
    var options = _.defaults(overrides, defaultConfig);

    /**
     * Configure Webpack to build scripts, styles, and other assets.
     *
     * JavaScript files are processed by Babel to compile ES6/ES2015 into
     * vanilla ES5 which can be run natively in current browsers.
     *
     * We use Autoprefixer to automatically add vendor-prefixes for appropriate
     * browsers. We use CSS-MQPacker to concatenate all media queries at the
     * end of our built stylesheets.
     *
     * Assets required in scripts or stylesheets are processed by Webpack and either
     * copied to dist directory, or inlined if under ~8kb.
     */
    var webpackConfig = {
        entry: options.bundles,
        output: {
            path: options.output,
            publicPath: '/',
            filename: '[name].js'
        },
        resolveLoader: {
            modulesDirectories: ['node_modules/fender/node_modules']
        },
        module: {
            loaders: [
                {
                    test: /\.js$/,
                    exclude: /node_modules/,
                    loaders: ['babel-loader'],
                },
                {
                    test: /\.(png|jpg|eot|gif|woff|svg|ttf)$/,
                    loader: 'url-loader?limit=8192'
                },
                {
                    test: /\.json$/,
                    loader: 'json-loader'
                }
            ]
        },
        postcss: function() {
            return [
                require('autoprefixer')({
                    browsers: options.autoprefixer<commit_msg>Use `loader` string syntax.<commit_after>'use strict';

var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var fs = require('fs');
var _ = require('lodash');

module.exports = function(pkg, overrides) {
    overrides = overrides || {};

    // Read environment from current NODE_ENV
    var environment = process.env.NODE_ENV || 'development';

    // Default settings
    var defaultConfig = {
        output: 'dist/',
        bundles: { /* see below */ },
        autoprefixer: ['last 4 versions', 'Firefox ESR', 'Opera 12.1'],
    };

    // If package has a name, use that as default input/output bundle
    if(pkg.name) {
        defaultConfig.bundles[pkg.name] = ['./src/' + pkg.name + '.js'];
    }

    if(process.env.NODE_ENV !== 'production') {
        _.map(defaultConfig.bundles, function(source) {
            source.push('webpack-dev-server/client?http://0.0.0.0:8080');
        })
    }

    // Override defaults where necessary
    var options = _.defaults(overrides, defaultConfig);

    /**
     * Configure Webpack to build scripts, styles, and other assets.
     *
     * JavaScript files are processed by Babel to compile ES6/ES2015 into
     * vanilla ES5 which can be run natively in current browsers.
     *
     * We use Autoprefixer to automatically add vendor-prefixes for appropriate
     * browsers. We use CSS-MQPacker to concatenate all media queries at the
     * end of our built stylesheets.
     *
     * Assets required in scripts or stylesheets are processed by Webpack and either
     * copied to dist directory, or inlined if under ~8kb.
     */
    var webpackConfig = {
        entry: options.bundles,
        output: {
            path: options.output,
            publicPath: '/',
            filename: '[name].js'
        },
        resolveLoader: {
            modulesDirectories: ['node_modules/fender/node_modules']
        },
        module: {
            loaders: [
                {
                    test: /\.js$/,
                    exclude: /node_modules/,
                    loader: 'babel-loader',
                },
                {
                    test: /\.(png|jpg|eot|gif|woff|svg|ttf)$/,
                    loader: 'url-loader?limit=8192'
                },
                {
                    test: /\.json$/,
                    loader: 'json-loader'
                }
            ]
        },
        postcss: function() {
            return [
                require('autoprefixer')({
                    browsers: options.autoprefixer
{'fraction_non_alphanumeric': 0.11772771792360431, 'fraction_numerical': 0.009010773751224289, 'mean_word_length': 1.7348687734333155, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4453782', 'n_tokens_mistral': 1459, 'n_tokens_neox': 1380, 'n_words': 368}