const { merge } = require("webpack-merge");
const common = require("./webpack.common");
const ImageMinimizerPlugin = require("image-minimizer-webpack-plugin");

let config = {
  mode: "production",
  optimization: {
    minimize: true,
    usedExports: true,
    minimizer: [
      new ImageMinimizerPlugin({
        minimizer: {
          implementation: ImageMinimizerPlugin.squooshMinify,
          options: {
            encodeOptions: {
              pngquant: {
                strip: true,
              }
            },
          },
        },
      }),
    ],
  },
  
};

module.exports = merge(common, config);