<commit_before>const webpack = require('webpack');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const definePluginReadFile = require('./webpack-define-read-file');

const relative = (pathPart) => path.resolve(__dirname, pathPart);
const dummyPullsPath = process.env.DUMMY_PULLS;
const dummyUser = process.env.DUMMY_USER;

module.exports = {
   module: {
      rules: [
         {
            // for any file with a suffix of js,jsx,ts,tsx
            test: /\.(jsx?|tsx?)$/,
            // ignore transpiling JavaScript from node_modules as it should be that state
            exclude: /node_modules/,
            // use the babel-loader for transpiling JavaScript to a suitable format
            use: [
               {
                  loader: 'babel-loader',
                  options: {
                     // attach the presets to the loader (most projects use .babelrc file instead)
                     presets: [
                        "@babel/preset-env",
                        ["@babel/preset-react", { runtime: "automatic" }]
                     ]
                  }
               },
               { loader: 'ts-loader' },
               { loader: 'eslint-loader' },
            ],
         }, {
            test: /\.less$/,
            use: [{
               loader: 'style-loader' // creates style nodes from JS strings
            }, {
               loader: 'css-loader'
            }, {
               loader: 'less-loader'
            }]
         },
      ]
   },
   resolve: {
      extensions: ['.ts', '.tsx', '.js', '.less'],
   },
   output: {
      path: relative("dist"),
      publicPath: '/frontend'
   },
   entry: {
      "main": relative("src/index.tsx"),
      "pull-card-demo": relative("test/pull-card-demo.tsx"),
   },
   plugins: [
      new webpack.DefinePlugin({
         "process.env.DUMMY_PULLS": dummyPullsPath ? definePluginReadFile(dummyPullsPath) : null,
         "process.env.DUMMY_USER": JSON.stringify(dummyUser),
      }),
      new HtmlWebpackPlugin({
         template: relative("index.html")
      }),
      new HtmlWebpackPlugin({
         filename: "./pull-card-demo.html",
         chunks: ["pull-card-demo"],
         template: relative("index.html")
      })
   ],
   mode: 'development',
   devtool: 'eval-cheap-module-source-map',
   devServer: {
      open: true,
      openPage: "frontend/"
   }
};<commit_msg>pull-card-demo: only include "main" chunk on main page<commit_after>const webpack = require('webpack');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const definePluginReadFile = require('./webpack-define-read-file');

const relative = (pathPart) => path.resolve(__dirname, pathPart);
const dummyPullsPath = process.env.DUMMY_PULLS;
const dummyUser = process.env.DUMMY_USER;

module.exports = {
   module: {
      rules: [
         {
            // for any file with a suffix of js,jsx,ts,tsx
            test: /\.(jsx?|tsx?)$/,
            // ignore transpiling JavaScript from node_modules as it should be that state
            exclude: /node_modules/,
            // use the babel-loader for transpiling JavaScript to a suitable format
            use: [
               {
                  loader: 'babel-loader',
                  options: {
                     // attach the presets to the loader (most projects use .babelrc file instead)
                     presets: [
                        "@babel/preset-env",
                        ["@babel/preset-react", { runtime: "automatic" }]
                     ]
                  }
               },
               { loader: 'ts-loader' },
               { loader: 'eslint-loader' },
            ],
         }, {
            test: /\.less$/,
            use: [{
               loader: 'style-loader' // creates style nodes from JS strings
            }, {
               loader: 'css-loader'
            }, {
               loader: 'less-loader'
            }]
         },
      ]
   },
   resolve: {
      extensions: ['.ts', '.tsx', '.js', '.less'],
   },
   output: {
      path: relative("dist"),
      publicPath: '/frontend'
   },
   entry: {
      "main": relative("src/index.tsx"),
      "pull-card-demo": relative("test/pull-card-demo.tsx"),
   },
   plugins: [
      new webpack.DefinePlugin({
         "process.env.DUMMY_PULLS": dummyPullsPath ? definePluginReadFile(dummyPullsPath) : null,
         "process.env.DUMMY_USER": JSON.stringify(dummyUser),
      }),
      new HtmlWebpackPlugin({
         template: relative("index.html"),
         chunks: ["main"],
      }),
      new HtmlWebpackPlugin({
         filename: "./pull-card-demo.html",
         chunks: ["pull-card-demo"],
         template: relative("index.html")
      })
   ],
   mode: 'development',
   devtool: 'eval-cheap-module-source-map',
   devServer: {
      open: true,
      openPage: "frontend/"
   }
};
{'fraction_non_alphanumeric': 0.1397433285801589, 'fraction_numerical': 0.0, 'mean_word_length': 1.6670287887017925, 'pattern_counts': {'":': 8, '<': 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': '2621457', 'n_tokens_mistral': 1422, 'n_tokens_neox': 1384, 'n_words': 299}