text: const merge = require('webpack-merge');
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
  const OptimizeCssPlugin = require('optimize-css-assets-webpack-plugin');
  const TerserPlugin = require('terser-webpack-plugin');
  const { CleanWebpackPlugin } = require('clean-webpack-plugin');
  
  const common = require('./webpack.common');
  
  module.exports = merge(common, {
    mode: 'production',
  
    optimization: {
      splitChunks: {
        chunks: 'all',
      },
      minimizer: [
        new OptimizeCssPlugin({
          cssProcessorPluginOptions: {
            preset: [
              'default',
              {
                discardComments: {
                  removeAll: true,
                },
              },
            ],
          },
        }),
        new TerserPlugin({
          extractComments: false,
          terserOptions: {
            output: {
              comments: false,
            },
          },
        }),
      ],
    },
  
    module: {
      rules: [
        {
          test: /\.s?css$/,
          use: [
            {
              loader: MiniCssExtractPlugin.loader,
              options: {
                publicPath: '../',
              },
            },
            'css-loader',
            'postcss-loader',
            'sass-loader',
          ],
        },
      ],
    },
  
    plugins: [
      new MiniCssExtractPlugin({
        filename: 'css/[name].[contentHash].css',
      }),
      new CleanWebpackPlugin(),
    ],
  });
  