<commit_before>var path = require("path");

const CleanWebpackPlugin = require('clean-webpack-plugin');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const port = process.env.PORT || 8000;
const {GenerateSW} = require('workbox-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');


var config = {
  entry: {
    index: path.resolve(__dirname, 'src/app.tsx')
  },

  optimization: {
    splitChunks: {
      chunks: 'all'
    }
  },

  output: {
    publicPath: '/',
    path: path.resolve(__dirname, "dist"),
    filename: '[name].js',
    chunkFilename: '[chunkhash].js'
  },

  plugins: [
    new CleanWebpackPlugin(['dist'], { root: __dirname, verbose: true, dry: false, exclude: [] }),
    new HtmlWebpackPlugin({
      template: path.resolve(__dirname, './src/index.html'),
      filename: 'template.html',
      inject: true,
      chunksSortMode: 'none' // https://github.com/jantimon/html-webpack-plugin/issues/870
    }),
		new GenerateSW({
      swDest: 'sw.js',
      clientsClaim: true,
      skipWaiting: true,
      navigateFallbackBlacklist: [/^\/blog.*/, /^.*\.txt$/, /^.*\.xml$/],
      navigateFallback: '/template.html'
    }),
  ],

  resolve: {
    extensions: [".ts", ".tsx", ".js", "*"],
    modules: [
      "node_modules",
      "src"
    ]
  },

  module: {
    rules: [{
      test: /\.ts(x?)$/,<commit_msg>Fixing bugs when clients sync for new version<commit_after>var path = require("path");

const CleanWebpackPlugin = require('clean-webpack-plugin');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const port = process.env.PORT || 8000;
const {GenerateSW} = require('workbox-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');


var config = {
  entry: {
    index: path.resolve(__dirname, 'src/app.tsx')
  },

  optimization: {
    splitChunks: {
      chunks: 'all'
    }
  },

  output: {
    publicPath: '/',
    path: path.resolve(__dirname, "dist"),
    filename: '[name]-[chunkhash].js',
    chunkFilename: '[chunkhash].js'
  },

  plugins: [
    new CleanWebpackPlugin(['dist'], { root: __dirname, verbose: true, dry: false, exclude: [] }),
    new HtmlWebpackPlugin({
      template: path.resolve(__dirname, './src/index.html'),
      filename: 'template.html',
      inject: true,
      chunksSortMode: 'none' // https://github.com/jantimon/html-webpack-plugin/issues/870
    }),
		new GenerateSW({
      swDest: 'sw.js',
      clientsClaim: true,
      skipWaiting: true,
      navigateFallbackBlacklist: [/^\/blog.*/, /^.*\.txt$/, /^.*\.xml$/],
      navigateFallback: '/template.html'
    }),
  ],

  resolve: {
    extensions: [".ts", ".tsx", ".js", "*"],
    modules: [
      "node_modules",
      "src"
    ]
  },

  module: {
    rules: [{
      test: /\.ts(x?)$/,
{'fraction_non_alphanumeric': 0.18785112359550563, 'fraction_numerical': 0.0049157303370786515, 'mean_word_length': 3.0070323488045005, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '871333', 'n_tokens_mistral': 964, 'n_tokens_neox': 936, 'n_words': 184}