text: const path = require('path');
  const HtmlWebPackPlugin = require("html-webpack-plugin");
  const { CleanWebpackPlugin } = require('clean-webpack-plugin');
  
  module.exports = {
      mode: 'development',
      entry: {
          index: './src/index.tsx'
      },
      devtool: 'inline-source-map',
      devServer: {
          contentBase: './dist',
          hot: true,
          historyApiFallback: true
      },
      module: {
        rules: [
          {
              test: /\.tsx?$/,
              use: 'ts-loader',
              exclude: /node_modules/,
          },
          {
              test: /\.(js|jsx)$/,
              exclude: /node_modules/,
              use: 
              {
                  loader: "babel-loader"
              },
          },
          {
              test: /\.css$/i,
              use: ['style-loader', 'css-loader'],
          },
          {
              test: /\.svg$/,
              use: [
                  {
                      loader: 'svg-url-loader',
                      options: {
                          limit: 10000,
                      }
                  }
              ]
          },
          {
              test: /\.html$/,
              use: 
              {
                  loader: "html-loader"
              },
          },
          {
              test: /\.(webp|jfif|png|gif|jpe?g|pdf)$/,
              use: [
                {
                  loader: 'file-loader',
                  options: {
                    name: '[name].[ext]'
                  }
                }
              ]
          }
        ]
      },
      resolve: {
          extensions: [ '.tsx', '.ts', '.js' ],
      },
      plugins: [
          new CleanWebpackPlugin(),
          new HtmlWebPackPlugin({
              title: 'Meet Paul Dang',
              template: "./src/index.html",
              filename: "./index.html",
              favicon: "./src/assets/icons/my-head.ico"
            })
      ],
      output: {
          filename: '[name].[contenthash].js',
          path: path.resolve(__dirname, 'dist'),
      },
      optimization: {
          moduleIds: 'deterministic',
          runtimeChunk: 'single',
          splitChunks: {
              cacheGroups: {
                  vendor: {
                  test: /[\\/]node_modules[\\/]/,
                  name: 'vendors',
                  chunks: 'all',
                  },
              },
          },
      }
  };