Argument | Description |
---|---|
sourcePath | Images' source directory (for example: /assets/images ) |
buildPath | Destination path (for example: /static/dist/ ) |
First argument to imagemin
constructor is plugin array. By default, following plugins are used: [imagemin.gifsicle(), imagemin.jpegtran(), imagemin.optipng(), imagemin.svgo()]
Second argument are options. In the above example following options are used:
{
progressive: true,
interlaced: true,
svgoPlugins: [{removeUnknownsAndDefaults: false}, {cleanupIDs: false}]
}
Those are completely optional.
progressive
is used by imagemin-jpegtran
.
interlaced
is used by imagemin-gifsicle
.
removeUnknownsAndDefaults
and cleanupIDs
are used by imagemin-svgo
.