Minimize webp images with gulp-imagemin and imagemin-webp

81 views Asked by At

I want to minimize existing webp images with gulp:

const imageminGulp = require('gulp-imagemin');
const imageminWebp = require('imagemin-webp');

function imagemin() {
  return gulp.src("img/**/*.{webp}")
    .pipe(imageminGulp([
      imageminWebp({ quality: 10 })
    ]))
    .pipe(gulp.dest('img'));
}

To test I want to minimize this image: https://file-examples.com/storage/fe34a88a9a65cf545955ccb/2020/03/file_example_WEBP_1500kB.webp from here https://file-examples.com/index.php/sample-images-download/sample-webp-download/

After running: gulp-imagemin: Minified 0 images

What I am doing wrong?

0

There are 0 answers