I'm having trouble getting gulp-imagemin 5.2.1 to use a different plugin from the defaults. I need to compress jpegs more than the default jpegtran plugin does with its lossless compression. I wanted to try using imagemin-jpeg-recompress 5.1.0. Here is my gulp task:
var imagemin = require('gulp-imagemin');
var imageminJpegRecompress = require('imagemin-jpeg-recompress');
gulp.task('imagemin', function(){
return gulp.src(['./app/img/**'], {base:'app'})
.pipe(plumber({errorHandler: onerror}))
.pipe(imagemin({
plugins:[imageminJpegRecompress({
quality: 'low'
})]
}))
.pipe(gulp.dest('dist/app/'));
});
When I run this, I get exactly the same images I got before no changes in how things are compressed. It looks like it doesn't even see the "plugins" option or maybe it's still running all of the default plugins after the jpegRecompress. How should I be calling the imagemin plugins in my gulp file?
Note: They did change the "plugins" option. The "plugins" option used to be named 'use".