text: const path = require('path');
  const common = require('./webpack.common');
  const merge = require('webpack-merge');
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
  const HtmlWebpackPlugin = require('html-webpack-plugin');
  const { CleanWebpackPlugin } = require('clean-webpack-plugin');
  const TerserPlugin = require('terser-webpack-plugin');
  const OptimizeCssAssetsPlugin = require("optimize-css-assets-webpack-plugin");
  
  module.exports = merge(common, {
    mode: 'production',
    output: {
      filename: 'main.[contentHash].js',
      path: path.resolve(__dirname, 'dist'),
    },
    optimization: {
      minimizer: [
        new TerserPlugin(),
        new OptimizeCssAssetsPlugin(),
      ]
    },
    plugins: [
      new MiniCssExtractPlugin({
        filename: '[name].[contentHash].css'
      }),
      new HtmlWebpackPlugin({
        template: './src/template.html',
        favicon: "./src/favicon.ico",
        minify: {
          removeAttributeQuotes: true,
          collapseWhitespace: true,
          removeComments: true,
        }
      }),
      new CleanWebpackPlugin()
    ],
    module: {
      rules: [
        {
          test: /\.scss$/,
          use: [
            MiniCssExtractPlugin.loader,
            'css-loader',
            'sass-loader',
          ],
        },
      ]
    },
  });