Created
January 7, 2022 18:34
-
-
Save apsolut/1df51f2b3ba45dc05a087117c398fa07 to your computer and use it in GitHub Desktop.
imagemin gulp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*--- images ----------*/ | |
| import imagemin from 'gulp-imagemin'; | |
| import imageminJpegtran from 'imagemin-jpegtran'; | |
| import imageminPngquant from 'imagemin-pngquant'; | |
| import imagemingifsicle from 'imagemin-gifsicle'; | |
| //import imageminSVG from 'imagemin-svgo'; | |
| function images(cb) { | |
| // do nothing if doImages is false | |
| if (!decomSettings.doImages) { | |
| return; | |
| } | |
| return src(['./dev/images/**/*.{png,jpg,gif,ico,svg}']) | |
| .pipe(imagemin([ | |
| // imagemingifsicle({interlaced: true}), | |
| imageminJpegtran({progressive: true}), | |
| //imageminPngquant({optimizationLevel: 5}), | |
| // imageminSVG({ | |
| // plugins: [ | |
| // {removeViewBox: true}, | |
| // {cleanupIDs: false} | |
| // ] | |
| // }) | |
| ])) | |
| .pipe(dest(decomSettings.themePath + '/images')); | |
| } | |
| exports.images = series( | |
| images | |
| //svgs | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment