text: const path = require("path");
  const { merge } = require('webpack-merge');
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
  const common = require('./webpack.common.js');
  
  /** 
   * @type {import("webpack").Configuration}
   */
  const config = {
    mode: "production",
    devtool: "source-map",
    module: {
      rules: [
        {
          test: /\.pug$/,
          use: [
            {
              loader: 'simple-pug-loader',
            }
          ]
        },
        {
          test: /\.s[ac]ss$/i,
          use: [
            MiniCssExtractPlugin.loader,
            "css-loader",
            "sass-loader",
          ],
        },
        {
          test: /\.m?js$/,
          exclude: /node_modules/,
          loader: 'babel-loader',
          options: {
            presets: ['@babel/preset-env'],
            plugins: [
              [
                "@babel/plugin-transform-runtime",
                {
                  "regenerator": true
                }
              ]
            ]
          }
        },
        {
          test: /\.(png|svg|jpg|jpeg|gif)$/i,
          type: 'asset/resource',
          generator: {
            filename: "assets/images/[name][[hash]][ext][query]"
          }
        },
        {
          test: /\.(woff|woff2|eot|ttf|otf)$/i,
          type: 'asset/resource',
          generator: {
            filename: "assets/fonts/[name][[hash]][ext][query]"
          }
        },
      ]
    },
    optimization: {
      moduleIds: "deterministic",
      runtimeChunk: 'single',
      usedExports: true,
      splitChunks: {
        cacheGroups: {
          vendor: {
            test: /[\\/]node_modules[\\/]/,
            name: 'vendors',
            chunks: 'all',
          }
        }
      }
    }
  }
  
  
  module.exports = merge(common, config);