<commit_before>/* global process */
/* eslint no-process-env: 0 */
const path = require('path')
const webpack = require('webpack')
const rootAssetPath = './src'

const config = {
  entry: {app: [`${rootAssetPath}/index`]},

  module: {
    rules: [
      {
        exclude: /node_modules/,
        test: /\.(js|jsx)$/,
        use: ['babel-loader']
      },
      {
        test: /\.scss?$/,
        use: [
          'style-loader',
          'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]',
          'sass-loader'
        ]
      },
      {
        test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
        use: ['url-loader?limit=10000&mimetype=application/font-woff']
      },
      {
        test: /\.(ttf|eot|svg|png)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
        use: ['file-loader']
      }
    ]
  },

  output: {
    filename: 'sentruba.js',
    path: path.resolve('./dist/')
  },

  plugins: [],

  resolve: {
    modules: [
      path.join(__dirname, 'src'),
      path.join(__dirname, 'node_modules')
    ]
  }

}

console.log('process.env.NODE_ENV', process.env.NODE_ENV) // eslint-disable-line no-console
if (process.env.NODE_ENV === 'development') {
  config.entry.app.unshift(
    'webpack-dev-server/client?http://localhost:3000',
    'webpack/hot/only-dev-server',
    'react-hot-loader/patch'
  )
  config.plugins.push(new webpack.HotModuleReplacementPlugin())
  config.output.publicPath = 'http://localhost:3000/assets/bundles/'
}
module.exports = config<commit_msg>Update webpack configuration to version 4<commit_after>/* global process */
/* eslint no-process-env: 0 */
const path = require('path')
const webpack = require('webpack')
const rootAssetPath = './src'

const mode = process.env.NODE_ENV || 'development'

const config = {
  devServer: {
    compress: true,
    contentBase: path.join(__dirname, 'dist'),
    hot: true,
    port: 3000
  },

  entry: {app: [`${rootAssetPath}/index`]},

  mode,

  module: {
    rules: [
      {
        exclude: /node_modules/,
        test: /\.(js|jsx)$/,
        use: ['babel-loader']
      },
      {
        test: /\.scss?$/,
        use: [
          'style-loader',
          'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]',
          'sass-loader'
        ]
      },
      {
        test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
        use: ['url-loader?limit=10000&mimetype=application/font-woff']
      },
      {
        test: /\.(ttf|eot|svg|png)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
        use: ['file-loader']
      }
    ]
  },

  output: {
    filename: 'sentruba.js',
    path: path.resolve('./dist/'),
    publicPath: 'http://localhost:3000/'
  },

  plugins: [
    new webpack.NamedModulesPlugin(),
    new webpack.HotModuleReplacementPlugin()
  ],

  resolve: {
    alias: {src: path.resolve('./src')},
    modules: [
      path.join(__dirname, 'src'),
      path.join(__dirname, 'node_modules')
    ]
  }

}

// console.log('process.env.NODE_ENV', process.env.NODE_ENV) // eslint-disable-line no-console
// if (process.env.NODE_ENV === 'development') {
//   config.entry.app.unshift(
//     'webpack-dev-server/client?http://localhost:3000',
//     'webpack/hot/only-dev-server',
//     'react-hot-loader/patch'
//   )
//   config.plugins.push(new webpack.HotModuleReplacementPlugin())
//   config.output.publicPath = 'http://localhost:3000/assets/bundles/'
// }
module.exports = config
{'fraction_non_alphanumeric': 0.20308857808857808, 'fraction_numerical': 0.020687645687645688, 'mean_word_length': 2.4364364364364364, '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': '6673208', 'n_tokens_mistral': 1265, 'n_tokens_neox': 1206, 'n_words': 170}