影象無失真壓縮(使用 gulp-imagemin)
imagemin 建構函式的第一個引數是外掛陣列。預設情況下,使用以下外掛:[imagemin.gifsicle(), imagemin.jpegtran(), imagemin.optipng(), imagemin.svgo()]
第二個論點是選項。在上面的示例中,使用了以下選項:
{
progressive: true,
interlaced: true,
svgoPlugins: [{removeUnknownsAndDefaults: false}, {cleanupIDs: false}]
}
這些是完全可選的。
progressive 使用 progressive。
interlaced 使用 interlaced。
removeUnknownsAndDefaults 和 cleanupIDs 由 imagemin-svgo 使用。