图像无损压缩(使用 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 使用。