Answer the question
In order to leave comments, you need to log in
Why is the pegtran utility of the imagemin plugin throwing an error?
When building, gulp throws an error: TypeError: $.gp.imagemin.jpegtran is not a function
What could it be and how to fix it?
module.exports = function () {
$.gulp.task('images', function () {
return $.gulp.src('build/img/**/*.{png,jpg,svg}')
.pipe ($.gp.imagemin([
$.gp.imagemin.jpegtran({progressive: true}),
$.imageminJpegRecompress({
loops: 5,
min: 65,
max: 70,
quality: 'medium'
}),
$. gp.imagemin.optipng({optimizationLevel: 3}),
$.pngquant({quality: '65-70', speed: 5}),
$.gp.imagemin.svgo()
]))
.pipe($.gulp.dest('build/img'));
});
};
Answer the question
In order to leave comments, you need to log in
Because in this version jpegtran is replaced by mozjpeg, respectively, it needs to be written in the code:
and everything will start) https://github.com/sindresorhus/gulp-imagemin$.gp.imagemin.mozjpeg({ progressive: true }),
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question