我正在使用gulp編譯我的工作,最近我使用gulp-imagemin插件來優化圖像,並且其工作仍未完全優化。在Google PageSpeed Insights中顯示圖像沒有完全優化。如何充分優化我的圖像?請幫忙。 這是我在我的gulpfile.js上使用的功能,它減少了約2-5%的圖像大小,但並未完全優化。gulp圖像優化器(gulp-imagemin)未完全優化
gulp.task('imgs', function() {
gulp
.src(paths.assets.images)
.pipe(imagemin({
progressive: true,
interlaced: true,
pngquant: true
}))
.pipe(flatten())
.pipe(gulp.dest(paths.build + "/img"));
});
下面是Google PageSpeed Insights顯示圖片未優化的截圖。
什麼是「優化以下圖像」鏈接推薦?我知道PageSpeed經常推薦使用WebP,在這種情況下'gulp-imagemin'不會幫助你。 –