text: // eslint-disable-next-line import/no-extraneous-dependencies
  const TerserPlugin = require('terser-webpack-plugin');
  // eslint-disable-next-line import/no-extraneous-dependencies
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
  // eslint-disable-next-line import/no-extraneous-dependencies
  const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
  const path = require('path');
  
  module.exports = {
    mode: 'production',
    entry: './src/index.js',
    output: {
      path: path.resolve(__dirname, '../dist'),
      filename: 'yo-mess-bundle.js',
    },
    module: {
      rules: [
        {
          test: /\.(js|jsx)$/,
          exclude: /node_modules/,
          use: {
            loader: 'babel-loader',
          },
        },
        {
          test: /\.html$/,
          use: [
            {
              loader: 'html-loader',
            },
          ],
        },
        {
          test: /\.s[ac]ss$/i,
          use: [
            'css-loader',
            'sass-loader',
          ],
        },
        {
          test: /\.less$/,
          use: [
            MiniCssExtractPlugin.loader,
            {
              loader: 'css-loader',
            },
            {
              loader: 'less-loader',
              options: {
                lessOptions: {
                  javascriptEnabled: true,
                  math: 'always',
                },
              },
            },
          ],
        },
      ],
    },
    resolve: {
      extensions: [
        '.js',
        '.json',
        '.jsx',
        '.css',
        '.less',
      ],
      fallback: {
        util: false,
        buffer: false,
        stream: false,
      },
    },
    plugins: [
      new MiniCssExtractPlugin({
        filename: 'yo-mess-style.css',
      }),
    ],
    optimization: {
      minimize: true,
      minimizer: [
        new TerserPlugin({
          test: /\.js(\?.*)?$/i,
        }),
        new CssMinimizerPlugin(),
      ],
    },
  };
  