gruntjs / grunt-contrib-imagemin

Minify PNG, JPG, GIF and SVG images.
https://gruntjs.com
MIT License
1.21k stars 175 forks source link

Write new files only if file size is reduced #400

Open mattyrob opened 1 year ago

mattyrob commented 1 year ago

This PR slightly updated the logic when processing files through the minification process.

Currently a conditional statement tracks if the file size has been reduced but all of the files a re-written, this means that files of the same size, or even larger files could be produced.

Moving the file write commands within the conditional statement will ensure files are only written when the file size has been reduced.

Also, I have included updated package-lock.json that includes some minor dependency updates that should be no-breaking without further manual testing required.

mattyrob commented 1 year ago

The Dependency upgrade address (all) 6 Critical, 12 High and 7 Moderate rated vulnerabilities.