text: const path = require('path');
  const HTMLWebpackPlugin = require("html-webpack-plugin");
  const { CleanWebpackPlugin } = require('clean-webpack-plugin');
  
  module.exports = {
      entry: './src/index.ts',
      module: {
          rules: [
              {
                  test: /\.ts$/,
                  exclude: /node_modules/,
                  loader: "swc-loader"
              },
              {
                  test: /\.html$/,
                  loader: "html-loader",
                  options: { minimize: true }
              },
              {
                  test: /\.scss/i,
                  use: ["style-loader", "css-loader", "sass-loader"]
              }
          ]
      },
      resolve: {
          extensions: ['.ts', '.js'],
      },
      output: {
          filename: 'bundle.js',
          path: path.resolve(__dirname, 'dist'),
      },
      plugins: [
          new HTMLWebpackPlugin({
              filename: 'index.html',
              template: path.join(__dirname, 'src/index.html')
          }),
          new CleanWebpackPlugin({
              cleanOnceBeforeBuildPatterns: [
                  'dist/**'
              ],
          }),
      ],
  };
  