<commit_before>'use strict';

var webpack           = require('webpack'),
    CleanPlugin       = require('clean-webpack-plugin'),
    ExtractTextPlugin = require('extract-text-webpack-plugin'),
    HtmlPlugin        = require('html-webpack-plugin'),
    ESManglePlugin    = require('esmangle-webpack-plugin'),
    BrowserSyncPlugin = require('browser-sync-webpack-plugin'),
    OmitTildePlugin   = require('omit-tilde-webpack-plugin');

var slash = require('slash');

function config() {

    // define Webpack configuration object to be exported
    return {
        context : __dirname,
        cache   : true,
        entry   : {
            app   : [
                './app/index.js',
                './app/index.scss'
            ],
            vendor: Object.keys(require('./bower.json').dependencies)
        },
        devtools: 'inline-source-map',
        output  : {
            path    : __dirname + '/app-build',
            filename: 'index.js'
        },
        resolve : {
            alias: {
                npm: __dirname + '/node_modules'
            },
            root : __dirname + '/bower_components'
        },
        module  : {
            preloaders: [
                {
                    test   : /\.js?$/,
                    exclude: './node_modules',
                    loader : 'jshint'
                }
            ],
            loaders   : [
                {
                    test  : /\.css$/,
                    loader: ExtractTextPlugin.extract(
                        'style',
                        'css?minimize&sourceMap!resolve-url?sourceMap'
                    )
                }, {
                    test  : /\.scss$/,
                    loader: ExtractTextPlugin.extract(
                        'style',
                        'css?minimize&sourceMap!resolve-url?sourceMap!sass'
                    )
                }, {
                    test   : /\.(jpe?g|png|gif|svg)$/i,
                    loaders: [
                        'file?hash=sha512&digest=hex&name=/assets/[hash].[ext]',
                        'image-webpack?optimizationLevel=7&interlaced=false'
                    ]
                }, {
                    test  : /\.woff2?$/,
                    loader: 'url?limit=10000&mimetype=application/font-woff&name=/assets/[hash].[ext]'
                }, {
                    test  : /\.(eot|ttf)$/,
                    loader: 'file?name=/assets/[hash].[ext]'
                }, {
                    test   : /\.js$/,
                    include: /bower_components/,
                    loader : 'ng-annotate?sourceMap'
                }, {
                    test   : /\.js$/,
                    exclude: /bower_components/,
                    loaders: [
                        'nginject?sourceMap',
                        'babel?stage=4&sourceMap'
                    ]
                }, {
                    test  : /\.html?$/,
                    loader: 'html'
                }, {
                    test  : /\.json$/,
                    loader: 'json'
                }
            ]
        },
        plugins : [
            new CleanPlugin(['app-build']),
            new OmitTildePlugin({
                include  : ['package.json', 'bower.json'],
                deprecate: true
            }),
            new webpack.ResolverPlugin([
                new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('bower.json', ['main'])
            ]),
            new ExtractTextPlugin('index.css'),
            new webpack.optimize.CommonsChunkPlugin(['vendor'], 'vendor.js'),
            new HtmlPlugin({
                title   : 'Custom template',
                template: __dirname + '/app/index.html',
                inject  : 'body'
            }),
            new webpack.optimize.DedupePlugin(),
            new ESManglePlugin(),
            new BrowserSyncPlugin({
                host  : 'localhost',
                port  : 55555,
                server: {
                    baseDir: ['app-build'],
                    routes : ['', 'bower_components', 'app-build']
                        .reduce(function mapRoutes(result, path) {
                            result['/' + slash(path)] = path; // result['/<path>'] = <path>
                            return result;
                        }, {})
                }
            })
        ]
    };
}

module.exports = config();<commit_msg>added some fixes from a larger project<commit_after>'use strict';

var webpack           = require('webpack'),
    CleanPlugin       = require('clean-webpack-plugin'),
    ExtractTextPlugin = require('extract-text-webpack-plugin'),
    HtmlPlugin        = require('html-webpack-plugin'),
    ESManglePlugin    = require('esmangle-webpack-plugin'),
    BrowserSyncPlugin = require('browser-sync-webpack-plugin'),
    OmitTildePlugin   = require('omit-tilde-webpack-plugin');

var slash = require('slash');

function config() {

    // define Webpack configuration object to be exported
    return {
        context : __dirname,
        cache   : true,
        entry   : {
            vendor: Object.keys(require('./bower.json').dependencies),
            index : [
                './app/index.js',
                './app/index.scss'
            ]
        },
        devtools: 'eval-source-map',
        output  : {
            path    : __dirname + '/app-build',
            filename: 'index.[hash].js'
        },
        resolve : {
            alias: {
                npm: __dirname + '/node_modules'
            },
            root : __dirname + '/bower_components'
        },
        module  : {
            preloaders: [
                {
                    test   : /\.js?$/,
                    exclude: './node_modules',
                    loader : 'jshint'
                }
            ],
            loaders   : [
                {
                    test  : /\.css$/,
                    loader: ExtractTextPlugin.extract(
                        'style',
                        'css?minimize&sourceMap!resolve-url?sourceMap'
                    )
                }, {
                    test  : /\.scss$/,
                    loader: ExtractTextPlugin.extract(
                        'style',
                        'css?minimize&sourceMap!resolve-url?sourceMap!sass'
                    )
                }, {
                    test   : /\.(jpe?g|png|gif|svg)$/i,
                    loaders: [
                        'file?hash=sha512&digest=hex&name=/assets/[hash].[ext]',
                        'image-webpack?optimizationLevel=7&interlaced=false'
                    ]
                }, {
                    test  : /\.woff2?$/,
                    loader: 'url?limit=10000&mimetype=application/font-woff&name=/assets/[hash].[ext]'
                }, {
                    test  : /\.(eot|ttf)$/,
                    loader: 'file?name=/assets/[hash].[ext]'
                }, {
                    test   : /\.js$/,
                    include: /bower_components/,
                    loader : 'ng-annotate?sourceMap'
                }, {
                    test   : /\.js$/,
                    exclude: /bower_components/,
                    loaders: [
                        'nginject?sourceMap',
                        'babel?stage=4&sourceMap&ignore=buffer' // https://github.com/feross/buffer/issues/79
                    ]
                }, {
                    test  : /\.html?$/,
                    loader: 'html'
                }, {
                    test  : /\.json$/,
                    loader: 'json'
                }
            ]
        },
        plugins : [
            new CleanPlugin(['app-build']),
            new OmitTildePlugin({
                include  : ['package.json', 'bower.json'],
                deprecate: true
            }),
            new webpack.ResolverPlugin([
                new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('bower.json', ['main'])
            ]),
            new webpack.ProvidePlugin({
                $     : 'jquery',
                jQuery: 'jquery'
            }),
            new ExtractTextPlugin('[name].[contenthash].css', {
                allChunks: true
            }),
            new webpack.optimize.CommonsChunkPlugin(['vendor'], 'vendor.[hash].js'),
            new HtmlPlugin({
                title   : 'Custom template',
                template: __dirname + '/app/index.html',
                inject  : 'body'
            }),
            new webpack.optimize.DedupePlugin(),
            new ESManglePlugin(),
            new BrowserSyncPlugin({
                host  : 'localhost',
                port  : 55555,
                server: {
                    baseDir: ['app-build'],
                    routes : ['', 'bower_components', 'app-build']
                        .reduce(function mapRoutes(result, path) {
                            result['/' + slash(path)] = path; // result['/<path>'] = <path>
                            return result;
                        }, {})
                }
            })
        ]
    };
}

module.exports = config();
{'fraction_non_alphanumeric': 0.1282923617208077, 'fraction_numerical': 0.0037313432835820895, 'mean_word_length': 1.035060294774453, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 1, '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': '4181100', 'n_tokens_mistral': 2444, 'n_tokens_neox': 2217, 'n_words': 351}