Lossless compression (imagemin-optipng)

PHOTO EMBED

Thu Oct 07 2021 08:58:05 GMT+0000 (UTC)

Saved by @GoodRequest. #react

import gulp from 'gulp'
import imagemin from 'gulp-imagemin'
import optipng from 'imagemin-optipng'

gulp.task('optimize-png-images', () => {
	return gulp.src('./build/static/media/*.png')
		.pipe(imagemin([
			optipng({optimizationLevel: 7})
		]))
		.pipe(gulp.dest('build/static/media/'))
})
content_copyCOPY