Home > other >  Is there any method to minimize images using webpack 5?
Is there any method to minimize images using webpack 5?

Time:01-22

I am literally getting lost inside a ton of articles, youtube videos, documentation of plugins loaders trying to find a way to minimize the size of images in webpack.
I need a way to do that with webpack 5 (with plugins loaders no problem).
Thank you guys.

CodePudding user response:

The best way to minimize your images as static assets is to pass them though image optim, so you can reduce their size by 70/80%. Then store them on a CDN such as Cloudinary and serve their url. This will greatly improve your client delivery time.

However, if you wish to compress your whole Webpack bundle, you can simply use the webpack compression plugin, with gizp and brotli algorithms.

EDIT: you may also use ImageMinimizerWebpackPlugin

  •  Tags:  
  • Related