<commit_before><commit_msg>Add webpack.config.js<commit_after>var _ = require('lodash');
var path = require('path');
var webpack = require('webpack');
var autoprefixer = require('autoprefixer');
var aliases = require('./aliases');

var isDebug = _.includes(process.argv, '--production') || _.includes(process.argv, '-p') ? false : true;

console.log(isDebug ? 'Building your stuff...' : 'Compiling for production...')
// webpack.config.js
if (process.env.NODE_ENV === 'development') {
  var loaders = ['react-hot','babel-loader']
} else {
  var loaders = ['babel-loader']
}

module.exports = {
  context: path.resolve(__dirname, '../../'),
  // Switch loaders to debug mode (not sure how this helps)
  debug: isDebug,

  // Better set this for development, because it creates source maps
  devtool: isDebug ? '#inline-source-map' : false,
  entry: 'index.js',
  output: {
    path: path.resolve(__dirname, '../../dist'),
    filename: 'bundle.js',
    publicPath: '/dist/'
  },
  resolve: {
     extensions: ['', '.js', '.jsx'],
     root: path.resolve(__dirname, '../../'),
     alias: aliases
  },
  devServer: {
    inline: true,
    port: 8080
  },
  module: {
    loaders: [{
      test: /.jsx?$/,
      loader: loaders,
      exclude: /node_modules/,
      query: {
        presets: ["es2015", "react", "stage-1"]
      },
      babelrc: false
    },
    {
      test: /\.css$/,
      loader: 'style-loader!css-loader!postcss-loader'
    }
  ]
  },
  postcss: function () {
    return [autoprefixer];
  }
};

{'fraction_non_alphanumeric': 0.18890356671070013, 'fraction_numerical': 0.0059445178335535, 'mean_word_length': 2.864795918367347, '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': '3691197', 'n_tokens_mistral': 510, 'n_tokens_neox': 501, 'n_words': 116}