text: 'use strict'; // eslint-disable-line
  
  const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
  const { default: ImageminPlugin } = require('imagemin-webpack-plugin');
  const imageminMozjpeg = require('imagemin-mozjpeg');
  const cssnano = require('cssnano');
  
  const config = require('./config');
  
  module.exports = {
    plugins: [
      new OptimizeCssAssetsPlugin({
        cssProcessor: cssnano,
        cssProcessorOptions: {
          discardComments: { removeAll: true },
          autoprefixer: { browsers: config.browsers },
        },
        canPrint: true,
      }),
      new ImageminPlugin({
        optipng: { optimizationLevel: 7 },
        gifsicle: { optimizationLevel: 3 },
        pngquant: { quality: '65-90', speed: 4 },
        svgo: {
          plugins: [
            { removeUnknownsAndDefaults: false },
            { cleanupIDs: false },
            { removeViewBox: false },
          ],
        },
        plugins: [imageminMozjpeg({ quality: 75 })],
        disable: (config.enabled.watcher),
      }),
    ],
  };
  