<commit_before>import path from 'path'
import webpack from 'webpack'
import autoprefixer from 'autoprefixer'
import HtmlWebpackPlugin from 'html-webpack-plugin'
import ExtractTextPlugin from 'extract-text-webpack-plugin'
import WebpackStableModuleIdAndHash from 'webpack-stable-module-id-and-hash'
import dotenv from 'dotenv'

const dotenvError = dotenv.config().error

if (dotenvError) {
  throw dotenvError
}

const START = process.env.npm_lifecycle_event === 'start'
const BUILD = process.env.npm_lifecycle_event === 'build'

const elmDir = path.resolve(__dirname, 'elm') + '/'
const jsDir = path.resolve(__dirname, 'js') + '/'

const config = {
  entry: './js/main.js',

  output: {
    path: './dist',
    filename: process.env.BASE_PATH + '/[name].[hash].js',
    hotUpdateChunkFilename: process.env.BASE_PATH + '/[id].[hash].hot-update.js',
    hotUpdateMainFilename: process.env.BASE_PATH + '/[hash].hot-update.json'
  },

  resolve: {
    extensions: ['', '.js', '.elm']
  },

  module: {
    noParse: /\.elm$/,
    preLoaders: [
      {
        test: /\.js$/,
        include: [jsDir],
        loader: 'eslint-loader'
      }
    ],
    loaders: [
      {
        test: /\.js$/,
        include: [jsDir],
        loader: 'babel-loader'
      },
      {
        test: /\.(png|jpg|gif|svg|ttf|otf|eot|svg|woff2?)$/,
        loader: 'url-loader?limit=8192'
      },
      {
        test: /\.elm$/,
        include: [elmDir],
        loader: `${START ? 'elm-hot!' : ''}elm-webpack?verbose=true&warn=true${START ? '&debug=true' : ''}&pathToMake=node_modules/.bin/elm-make`
      }
    ]
  },

  plugins: [
    new HtmlWebpackPlugin({
      template: 'html/index.html',
      inject: 'body',
      minify: require('./html-minifier.json')
    }),
    new webpack.DefinePlugin({
      '__CONFIG__': {
        basePath: JSON.stringify(process.env.BASE_PATH)
      }
    })
  ],

  postcss: [ autoprefixer({ browsers: ['last 2 versions']} ) ],

  eslint: {
    failOnWarning: true,
    failOnError: true
  },

  devServer: {
    stats: 'errors-only',
    historyApiFallback: true
  }
}<commit_msg>Simplify webpack.config<commit_after>import path from 'path'
import webpack from 'webpack'
import autoprefixer from 'autoprefixer'
import HtmlWebpackPlugin from 'html-webpack-plugin'
import ExtractTextPlugin from 'extract-text-webpack-plugin'
import WebpackStableModuleIdAndHash from 'webpack-stable-module-id-and-hash'
import dotenv from 'dotenv'

const dotenvError = dotenv.config().error

if (dotenvError) {
  throw dotenvError
}

const START = process.env.npm_lifecycle_event === 'start'
const BUILD = process.env.npm_lifecycle_event === 'build'

const jsDir = path.resolve(__dirname, 'js') + '/'

const config = {
  entry: './js/main.js',

  output: {
    path: './dist',
    filename: process.env.BASE_PATH + '/[name].[hash].js',
    hotUpdateChunkFilename: process.env.BASE_PATH + '/[id].[hash].hot-update.js',
    hotUpdateMainFilename: process.env.BASE_PATH + '/[hash].hot-update.json'
  },

  resolve: {
    extensions: ['', '.js', '.elm']
  },

  module: {
    noParse: /\/Main\.elm$/,
    preLoaders: [
      {
        test: /\.js$/,
        include: [jsDir],
        loader: 'eslint-loader'
      }
    ],
    loaders: [
      {
        test: /\.js$/,
        include: [jsDir],
        loader: 'babel-loader'
      },
      {
        test: /\.(png|jpg|gif|svg|ttf|otf|eot|svg|woff2?)$/,
        loader: 'url-loader?limit=8192'
      },
      {
        test: /\/Main\.elm$/,
        loader: `${START ? 'elm-hot!' : ''}elm-webpack?verbose=true&warn=true${START ? '&debug=true' : ''}&pathToMake=node_modules/.bin/elm-make`
      }
    ]
  },

  plugins: [
    new HtmlWebpackPlugin({
      template: 'html/index.html',
      inject: 'body',
      minify: require('./html-minifier.json')
    }),
    new webpack.DefinePlugin({
      '__CONFIG__': {
        basePath: JSON.stringify(process.env.BASE_PATH)
      }
    })
  ],

  postcss: [ autoprefixer({ browsers: ['last 2 versions']} ) ],

  eslint: {
    failOnWarning: true,
    failOnError: true
  },

  devServer: {
    stats: 'errors-only',
    historyApiFallback: true
  }
}
{'fraction_non_alphanumeric': 0.1696881798404641, 'fraction_numerical': 0.0029006526468455403, 'mean_word_length': 2.734657039711191, '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': '3272849', 'n_tokens_mistral': 1471, 'n_tokens_neox': 1429, 'n_words': 259}