Answer the question
In order to leave comments, you need to log in
Why are webp not converted to gulp?
Good day.
Connected plugin for converting images to webp format
const imagemin = require('gulp-imagemin')
const webpConvert = require('imagemin-webp');
exports.webp = webp = (done) => {
gulp.src('./src/images/*.{png,jpg,jpeg}')
.pipe(imagemin([
webpConvert({ quality: 80 })
]))
.pipe(gulp.dest('./build/assets/images'))
done()
}
gulp webp
, and I get the following response:[15:01:08] Using gulpfile ~\indevelop\frontbuild\gulpfile.js
[15:01:08] Starting 'webp'...
[15:01:08] Finished 'webp' after 12 ms
[15:01:10] gulp-imagemin: Minified 5 images (saved 2.61 MB - 59.4%)
gulp-webp
still does not appear. They are simply not there.
Answer the question
In order to leave comments, you need to log in
Good afternoon. recently did a task for webp:
gulp.task("imgsWebp", function() {
return gulp.src("src/blocks/**/*.{jpg,jpeg,png,gif,ico}")
// Конвертирует изображение в webp и сжимает его.
.pipe(webp({
quality: 100
}))
// Выгрузка.
.pipe(gulp.dest(buildImgs))
// Browsersync.
.pipe(gulpif(!dist, browserSync.stream())); // Если нет флага --dist.
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question