<commit_before>var webpack = require('webpack');
var yargs = require('yargs').argv;
var testing = yargs.env === 'test';

//------------------------------------------------------------------------------
// https://github.com/webpack/webpack/issues/839#issuecomment-177219660
function getExternals() {
    var fs = require('fs');
    var nodeModules = {};

    fs.readdirSync('node_modules').forEach(function (module) {
      if (module !== '.bin') {
        nodeModules[module] = true;
      }
    });

    var nodeModulesTransform = function(context, request, callback) {
      // search for a '/' indicating a nested module
      var slashIndex = request.indexOf("/");
      var rootModuleName;
      if (slashIndex == -1) {
        rootModuleName = request;
      } else {
        rootModuleName = request.substr(0, slashIndex);
      }

      // Match for root modules that are in our node_modules
      if (nodeModules.hasOwnProperty(rootModuleName)) {
        callback(null, "commonjs " + request);
      } else {
        callback();
      }
    };
    return nodeModulesTransform;
}
//------------------------------------------------------------------------------

var config = {
    entry: './src/redux-decorators.ts',
    resolve: {
        extensions: ['', '.ts', '.js']
    },
    module: {
        loaders: [
            { test: /\.ts$/, loader: 'ts-loader' }
        ]
    },
    "compilerOptions": {
        "module": "commonjs",
        "sourceMap": true
      },
    output: {
        filename: './dist/redux-decorators.js',
        library: 'ReduxDecorators',
        libraryTarget: 'umd'
    },
    externals: getExternals(),
    plugins: [
        new webpack.ProvidePlugin({
            // 'redux': 'Redux'
        })
    ],
    // Turn on sourcemaps
    devtool: 'source-map'
};

var testingDecorator = function(config) {
    config.entry = './test/reducer.spec.ts';
    config.target = 'node';
    config.output = {};
    config.output.filename = './dist/redux-decorators.spec.js';
    return config;
};

if (testing) {
    config = testingDecorator(config);
}

module.exports = config;
<commit_msg>Update webpack config<commit_after>var webpack = require('webpack');
var yargs = require('yargs').argv;
var testing = yargs.env === 'test';

//------------------------------------------------------------------------------
// https://github.com/webpack/webpack/issues/839#issuecomment-177219660
function getExternals() {
    var fs = require('fs');
    var nodeModules = {};

    fs.readdirSync('node_modules').forEach(function (module) {
      if (module !== '.bin') {
        nodeModules[module] = true;
      }
    });

    var nodeModulesTransform = function(context, request, callback) {
      // search for a '/' indicating a nested module
      var slashIndex = request.indexOf("/");
      var rootModuleName;
      if (slashIndex == -1) {
        rootModuleName = request;
      } else {
        rootModuleName = request.substr(0, slashIndex);
      }

      // Match for root modules that are in our node_modules
      if (nodeModules.hasOwnProperty(rootModuleName)) {
        callback(null, "commonjs " + request);
      } else {
        callback();
      }
    };
    return nodeModulesTransform;
}
//------------------------------------------------------------------------------

var config = {
    entry: './src/redux-decorators.ts',
    resolve: {
        extensions: ['', '.ts', '.js']
    },
    module: {
        loaders: [
            { test: /\.ts$/, loader: 'ts-loader' }
        ]
    },
    "compilerOptions": {
        "module": "commonjs",
        "sourceMap": true
      },
    output: {
        filename: './dist/redux-decorators.js',
        library: 'ReduxDecorators',
        libraryTarget: 'umd'
    },
    externals: getExternals(),
    plugins: [
        new webpack.ProvidePlugin({
            // 'redux': 'Redux'
        })
    ],
    // Turn on sourcemaps
    devtool: 'source-map'
};

var testingDecorator = function(config) {
    config.entry = './test/reducer.decorator.spec.ts';
    config.target = 'node';
    config.output = {};
    config.output.filename = './dist/redux-decorators.spec.js';
    return config;
};

if (testing) {
    config = testingDecorator(config);
}

module.exports = config;

{'fraction_non_alphanumeric': 0.2158290277125411, 'fraction_numerical': 0.006575857209957727, 'mean_word_length': 1.8130779392338177, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '2311031', 'n_tokens_mistral': 1235, 'n_tokens_neox': 1222, 'n_words': 252}