I
I
IIIu6ko2019-10-17 14:17:52
Node.js
IIIu6ko, 2019-10-17 14:17:52

How to make a copy of an image?

There is such a task:

gulp.task("imgs", function() {
  return gulp.src("src/blocks/**/*.{jpg,jpeg,png,gif,ico}")

    // Конвертирует изображение в webp и сжимает его
    .pipe(webp({
      quality: 75
    }))

    // Если флаг --dist, то выгружает по пути distImgs, иначе по пути buildImgs.
    .pipe(gulpif(dist, gulp.dest(distImgs), gulp.dest(buildImgs)))

    // Browsersync
    .pipe(gulpif(!dist, browserSync.stream())); // Если нет флага --dist или --github.
});

webp = gulp-webp
Please tell me how to make a copy of the image with the webp format?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orbb, 2019-10-17
@IIIu6ko

copy the images folder before gulp conversion, set the gulp on the folder. One will contain the originals, the other will contain the converted

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question