<commit_before>const path = require('path')
const webpack = require('webpack')
const cssnano = require('cssnano')
const settings = require('./settings')
const styleLoader = require('./style-loader')
const AddAssetHtmlPlugin = require('add-asset-html-webpack-plugin')

const isProduction = process.env.NODE_ENV === 'production'
const env = isProduction ? 'build' : 'dev'
const assetsPath = curPath => path.posix.join(settings[env].assets.subDir, curPath)
const resolve = dir => path.join(__dirname, '..', dir)
const publicPath = dir => settings[env].publicPath + dir
const assetConfig = (filename, hash) => ({
  filepath: require.resolve(filename),
  outputPath: 'js',
  publicPath: publicPath('js'),
  includeSourcemap: false,
  hash: hash || false
})

let loaderRules = [
  {
    test: /\.(js|jsx)$/,
    loader: 'babel-loader',
    include: [resolve('src'), resolve('test')]
  }, {
    test: /\.css$/,
    use: styleLoader()
  }, {
    test: /\.less$/,
    use: styleLoader('less-loader')
  }, {
    test: /\.(scss|sass)$/,
    use: styleLoader('sass-loader')
  }, {
    test: /\.(stylus|styl)$/,
    use: styleLoader('stylus-loader')
  }, {
    test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
    loader: 'url-loader',
    query: {
      limit: 8192,
      name: assetsPath('images/[name].[hash:7].[ext]')
    }
  }, {
    test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
    loader: 'url-loader',
    query: {
      limit: 8192,
      name: assetsPath('fonts/[name].[hash:7].[ext]')
    }
  }
]

if (!isProduction && settings.dev.lint) {
  loaderRules = [{
    test: /\.(js|jsx)$/,
    loader: 'eslint-loader',
    enforce: 'pre',
    include: [resolve('src'), resolve('test')],
    options: {
      formatter: require('eslint-friendly-formatter')
    }
  }].concat(loaderRules)
}
<commit_msg>update base webpack config<commit_after>const path = require('path')
const webpack = require('webpack')
const cssnano = require('cssnano')
const settings = require('./settings')
const styleLoader = require('./style-loader')
const AddAssetHtmlPlugin = require('add-asset-html-webpack-plugin')

const isProduction = process.env.NODE_ENV === 'production'
const env = isProduction ? 'build' : 'dev'
const assetsPath = curPath => path.posix.join(settings[env].assets.subDir, curPath)
const resolve = dir => path.join(__dirname, '..', dir)
const publicPath = dir => settings[env].publicPath + dir
const assetConfig = (filename, hash) => ({
  filepath: require.resolve(filename),
  outputPath: 'js',
  publicPath: publicPath('js'),
  includeSourcemap: false,
  hash: hash || false
})

let loaderRules = [
  {
    test: /\.(js|jsx)$/,
    loader: 'babel-loader',
    include: [resolve('src'), resolve('test')]
  }, {
    test: /\.css$/,
    use: styleLoader()
  }, {
    test: /\.less$/,
    use: styleLoader('less-loader')
  }, {
    test: /\.(scss|sass)$/,
    use: styleLoader('sass-loader')
  }, {
    test: /\.(stylus|styl)$/,
    use: styleLoader('stylus-loader')
  }, {
    test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
    loader: 'url-loader',
    query: {
      limit: 8192,
      name: assetsPath('images/[name].[hash:7].[ext]')
    }
  }, {
    test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
    loader: 'url-loader',
    query: {
      limit: 8192,
      name: assetsPath('fonts/[name].[hash:7].[ext]')
    }
  }
]

if (settings[env].lint) {
  loaderRules = [{
    test: /\.(js|jsx)$/,
    loader: 'eslint-loader',
    enforce: 'pre',
    include: [resolve('src'), resolve('test')],
    options: {
      formatter: require('eslint-friendly-formatter')
    }
  }].concat(loaderRules)
}

{'fraction_non_alphanumeric': 0.20872011251758088, 'fraction_numerical': 0.006188466947960619, 'mean_word_length': 3.373923739237392, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '5410953', 'n_tokens_mistral': 1281, 'n_tokens_neox': 1225, 'n_words': 236}