diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index 2b1b3bbd47d..67933ee3a00 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -18,6 +18,7 @@ const InlineChunkHtmlPlugin = require('react-dev-utils/InlineChunkHtmlPlugin'); const TerserPlugin = require('terser-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); +const ImageMinimizerPlugin = require('image-minimizer-webpack-plugin'); const { WebpackManifestPlugin } = require('webpack-manifest-plugin'); const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin'); const WorkboxWebpackPlugin = require('workbox-webpack-plugin'); @@ -298,6 +299,14 @@ module.exports = function (webpackEnv) { }), // This is only used in production mode new CssMinimizerPlugin(), + // This is only used in production mode + new ImageMinimizerPlugin({ + minimizer: { + options: { + plugins: ['gifsicle', 'jpegtran', 'optipng', 'svgo'], + }, + }, + }), ], }, resolve: {