Skip to content

Commit

Permalink
Readme fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Aug 12, 2021
1 parent 2f7ecc9 commit fbb6fbe
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ export default () => (
### Custom plugin options

```js
import imagemin, {gifsicle, mozjpeg, optipng, svgo} from 'gulp-imagemin';

//
.pipe(imagemin([
imagemin.gifsicle({interlaced: true}),
imagemin.mozjpeg({quality: 75, progressive: true}),
imagemin.optipng({optimizationLevel: 5}),
imagemin.svgo({
gifsicle({interlaced: true}),
mozjpeg({quality: 75, progressive: true}),
optipng({optimizationLevel: 5}),
svgo({
plugins: [
{removeViewBox: true},
{cleanupIDs: false}
Expand All @@ -46,9 +48,11 @@ export default () => (
### Custom plugin options and custom `gulp-imagemin` options

```js
import imagemin, {svgo} from 'gulp-imagemin';

//
.pipe(imagemin([
imagemin.svgo({
svgo({
plugins: [
{
removeViewBox: true
Expand Down Expand Up @@ -79,7 +83,7 @@ Unsupported files are ignored.
#### plugins

Type: `Array`\
Default: `[imagemin.gifsicle(), imagemin.mozjpeg(), imagemin.optipng(), imagemin.svgo()]`
Default: `[gifsicle(), mozjpeg(), optipng(), svgo()]`

[Plugins](https://www.npmjs.com/browse/keyword/imageminplugin) to use. This will completely overwrite all the default plugins. So, if you want to use custom plugins and you need some of defaults too, then you should pass default plugins as well. Note that the default plugins come with good defaults and should be sufficient in most cases. See the individual plugins for supported options.

Expand Down

0 comments on commit fbb6fbe

Please sign in to comment.