text: const path = require('path');
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
  const { CleanWebpackPlugin } = require('clean-webpack-plugin');
  const common = require('./webpack.common');
  const { merge } = require('webpack-merge');
  const WorkboxPlugin = require('workbox-webpack-plugin');
  const TerserPlugin = require("terser-webpack-plugin");
  
  
  module.exports = merge(common, {
      mode: 'production',
      output: {
          filename: "main.[contenthash].js",
          path: path.resolve(__dirname, 'dist'),
      },
      module: {
          rules: [
              {
                  test: /\.s[ac]ss$/i,
                  use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'],
              },
          ]
      },
      optimization: {
          minimize: true,
          minimizer: [new TerserPlugin()],
      },
      plugins: [
          new MiniCssExtractPlugin({
              filename: "[name].[contenthash].css"
          }),
          new CleanWebpackPlugin({}),
          new WorkboxPlugin.GenerateSW({
              // these options encourage the ServiceWorkers to get in there fast
              // and not allow any straggling "old" SWs to hang around
              clientsClaim: true,
              skipWaiting: true,
          }),
      ]
  });
  