<commit_before>'use strict'

const path = require('path')

const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')

const htmlIndex = 'index.html'

const entryFile = path.resolve(__dirname, '../src/index.js')
const keymapsDir = path.resolve(__dirname, '../public/keymaps')
const clientsDir = path.resolve(__dirname, '../public/clients')
const rootFiles = path.resolve(__dirname, '../public/*.*')

/**
 * @param {string}appBundle
 * @param {string}buildDir
 * @param {boolean}debug
 * @return {{entry: string, output: {path: string, filename: string}, plugins: *[]}}
 */
const commonConfig = (appBundle, buildDir, debug) => {
  return {
    entry: [entryFile],
    output: {
      path: path.resolve(__dirname, `../${buildDir}`),
      publicPath: '/',
      filename: appBundle
    },
    plugins: [
      new CopyWebpackPlugin([
        { from: keymapsDir, to: 'keymaps' },
        { from: clientsDir, to: 'clients' },
        { from: rootFiles, to: '.', flatten: true }
      ]),
      new HtmlWebpackPlugin({
        file: htmlIndex,
        title: 'Greenfield',
        meta: { viewport: 'width=device-width, initial-scale=1, shrink-to-fit=no' },
        favicon: path.resolve(__dirname, `../public/favicon.ico`),
        minify: debug ? false : {
          removeAttributeQuotes: true,
          collapseWhitespace: true,
          html5: true,
          minifyCSS: true,
          removeComments: true,
          removeEmptyAttributes: true
        }
      })
    ],
    module: {
      rules: [
        {
          test: /\.css$/,
          use: ['style-loader', 'css-loader']
        }
      ]
    }
  }<commit_msg>don't try to copy webclients in build artifact<commit_after>'use strict'

const path = require('path')

const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')

const htmlIndex = 'index.html'

const entryFile = path.resolve(__dirname, '../src/index.js')
const keymapsDir = path.resolve(__dirname, '../public/keymaps')
// const clientsDir = path.resolve(__dirname, '../public/clients')
const rootFiles = path.resolve(__dirname, '../public/*.*')

/**
 * @param {string}appBundle
 * @param {string}buildDir
 * @param {boolean}debug
 * @return {{entry: string, output: {path: string, filename: string}, plugins: *[]}}
 */
const commonConfig = (appBundle, buildDir, debug) => {
  return {
    entry: [entryFile],
    output: {
      path: path.resolve(__dirname, `../${buildDir}`),
      publicPath: '/',
      filename: appBundle
    },
    plugins: [
      new CopyWebpackPlugin([
        { from: keymapsDir, to: 'keymaps' },
        // { from: clientsDir, to: 'clients' },
        { from: rootFiles, to: '.', flatten: true }
      ]),
      new HtmlWebpackPlugin({
        file: htmlIndex,
        title: 'Greenfield',
        meta: { viewport: 'width=device-width, initial-scale=1, shrink-to-fit=no' },
        favicon: path.resolve(__dirname, `../public/favicon.ico`),
        minify: debug ? false : {
          removeAttributeQuotes: true,
          collapseWhitespace: true,
          html5: true,
          minifyCSS: true,
          removeComments: true,
          removeEmptyAttributes: true
        }
      })
    ],
    module: {
      rules: [
        {
          test: /\.css$/,
          use: ['style-loader', 'css-loader']
        }
      ]
    }
  }
{'fraction_non_alphanumeric': 0.1573066745074978, 'fraction_numerical': 0.0011761246692149367, 'mean_word_length': 2.5511482254697286, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2361993', 'n_tokens_mistral': 1049, 'n_tokens_neox': 1037, 'n_words': 231}