text: const webpack = require("webpack");
  const path = require("path");
  const CopyPlugin = require("copy-webpack-plugin");
  const srcDir = path.join(__dirname, "..", "src", "ts");
  
  module.exports = {
      entry: {
        popup: path.join(srcDir, 'popup.tsx'),
        options: path.join(srcDir, 'options.tsx'),
        background: path.join(srcDir, 'background.ts'),
      },
      output: {
          path: path.join(__dirname, "../dist/js"),
          filename: "[name].js",
      },
      optimization: {
          splitChunks: {
              name: "vendor",
              chunks(chunk) {
                return chunk.name !== 'background';
              }
          },
      },
      module: {
          rules: [
              {
                  test: /\.tsx?$/,
                  use: "ts-loader",
                  exclude: /node_modules/,
              },
          ],
      },
      resolve: {
          extensions: [".ts", ".tsx", ".js"],
      },
      plugins: [
          new CopyPlugin({
              patterns: [{ from: ".", to: "../", context: "public" }],
              options: {},
          }),
      ],
  };
  