Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include the webpack Image Minimizer Plugin. #208

Open
wants to merge 2 commits into
base: v1
Choose a base branch
from

Conversation

mattheu
Copy link
Member

@mattheu mattheu commented Aug 25, 2022

This plugin can optimise any images that are bundled as part of our build process.

I have configured this out of the box to minimze images losslessly using the following:

  • SVGs are compressed with SVGO (I actually linked to a web interface for this and is a tool I use regularly). Often we'll use icons and logos provided by designers that are poorly optimised. SVG files can contain lots of stuff generated by the tool used to create the image. SVGO strips it out and can often reduce file sizes by 50% or more.
  • JPG files are compressed using jpegtran. I tested this on a 4.6MB file and it reduced it by about 7%. So not a lot! But better than nothing.
  • PNG files. I tested on a couple of images. One very small one exported from Figma, was reduced by about 40% (from 2kb to 1.3kb). But repeating this with another image I didn't see any improvement at all. I guess it depends how well optimised the source image is.

It can support lossy minimization too which I haven't really investigated but it would be good to allow this to be configured with either 🤔

All in all, seems like an easy enhancement to add with little downside.

Any thoughts on including this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant