<commit_before>const HtmlWebpackPlugin = require('html-webpack-plugin')
const { pages } = require('./chippanfire.js')
const webpack = require('webpack')

const afterLastSlash = x => x.split('/')[x.split('/').length - 1] || x
const beforeLastDot = x => x.split('.')[x.split('.').length - 2]
const scriptName = x => beforeLastDot(afterLastSlash(x))

const scripts = pages.reduce((acc, page) => acc.concat(page.scripts) , []).concat('./assets/common.js')

module.exports = {
  entry: scripts.reduce((acc, script) => Object.assign(acc, { [scriptName(script)]: `./${script}` }), {}),
  output: {
    filename: '[name]-[hash].js',
    path: __dirname + '/dist'
  },
  plugins: [
    new webpack.optimize.UglifyJsPlugin({
      compress: {
        warnings: false
      }
    })
  ].concat(pages.map(page => new HtmlWebpackPlugin({
    chunks: ['common'].concat(page.scripts.map(scriptName)),
    filename: page.file,
    template: `./build/${page.file}`
  }))),
  module: {
    rules: [{
        test: /\.css$/,
        loader: 'style-loader!css-loader'
      },
      {
        test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
        loader: "file-loader"
      },
      {
        test: /\.(woff|woff2)$/,
        loader: "url-loader?prefix=font/&limit=5000"
      },
      {
        test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
        loader: "url-loader?limit=10000&mimetype=application/octet-stream"
      },
      {
        test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
        loader: "url-loader?limit=10000&mimetype=image/svg+xml"
      },
      {
        test: /\.(png|jpg)$/,
        loader: 'url-loader?limit=8192'
      }
    ]
  }
}<commit_msg>Push html into top level of dist/, everything else under dist/assets/<commit_after>const HtmlWebpackPlugin = require('html-webpack-plugin')
const { pages } = require('./chippanfire.js')
const webpack = require('webpack')

const afterLastSlash = x => x.split('/')[x.split('/').length - 1] || x
const beforeLastDot = x => x.split('.')[x.split('.').length - 2]
const scriptName = x => beforeLastDot(afterLastSlash(x))

const scripts = pages.reduce((acc, page) => acc.concat(page.scripts) , []).concat('./assets/common.js')

module.exports = {
  entry: scripts.reduce((acc, script) => Object.assign(acc, { [scriptName(script)]: `./${script}` }), {}),
  output: {
    filename: '[name]-[hash].js',
    path: __dirname + '/dist/assets'
  },
  plugins: [
    new webpack.optimize.UglifyJsPlugin({
      compress: {
        warnings: false
      }
    })
  ].concat(pages.map(page => new HtmlWebpackPlugin({
    chunks: ['common'].concat(page.scripts.map(scriptName)),
    filename: `../${page.file}`,
    template: `./build/${page.file}`
  }))),
  module: {
    rules: [{
        test: /\.css$/,
        loader: 'style-loader!css-loader'
      },
      {
        test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
        loader: "file-loader?outputPath=fonts/"
      },
      {
        test: /\.(woff|woff2)$/,
        loader: "url-loader?prefix=font/&limit=5000&outputPath=fonts/"
      },
      {
        test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
        loader: "url-loader?limit=10000&mimetype=application/octet-stream&outputPath=fonts/"
      },
      {
        test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
        loader: "url-loader?limit=10000&mimetype=image/svg+xml&outputPath=images/"
      },
      {
        test: /\.(png|jpg)$/,
        loader: 'url-loader?limit=8192&outputPath=images/'
      }
    ]
  }
}
{'fraction_non_alphanumeric': 0.22378854625550662, 'fraction_numerical': 0.012334801762114538, 'mean_word_length': 2.5222337125129264, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '304481', 'n_tokens_mistral': 1235, 'n_tokens_neox': 1198, 'n_words': 178}