text: const path = require("path");
  const webpack = require("webpack");
  const HtmlWebpackPlugin = require("html-webpack-plugin");
  
  module.exports = {
    mode: "development",
    entry: ["react-hot-loader/patch", "./src/index.tsx"],
    output: {
      filename: "bundle.js",
      path: path.resolve(__dirname, "public"),
    },
    resolveLoader: {
      moduleExtensions: ["-loader"],
    },
    resolve: {
      extensions: [".ts", ".tsx", ".js", "jsx"],
    },
    plugins: [
      new HtmlWebpackPlugin({
        template: "./public/index.html",
        filename: "./index.html",
        inject: false,
      }),
    ],
    module: {
      rules: [
        {
          test: /\.(js|jsx|ts|tsx)$/,
          exclude: /node_modules/,
          loader: "babel-loader",
        },
        {
          test: /\.ts[x]?$/,
          exclude: /node_modules/,
          use: [
            {
              loader: "ts-loader",
              options: {
                transpileOnly: true,
              },
            },
          ],
        },
      ],
    },
  };
  