2.0.1 • Published 4 years ago

@eklingen/vinyl-stream-imagemin v2.0.1

Weekly downloads
10
License
MIT
Repository
github
Last release
4 years ago

Small vinyl-stream wrapper -aka Gulp plugin- for imagemin

Run imagemin within your streams. Lazy loads plugins. This comes with quite a few subdependencies to download or compile the binaries. If "just optimize .png, .jpg and .svg" is good enough, take a look at "@eklingen/vinyl-stream-optimize-images". That one comes with batteries included.

NOTE: No tests have been written yet!

Installation

yarn install. Or npm install. Or just copy the files to your own project.

Usage

const imageminWrapper = require('@eklingen/vinyl-stream-imagemin')
stream.pipe(imageminWrapper())

Options

There are a few options you can play with:

plugins

What plugins you intend to use. Possible options are jpegoptim, optipng and svgo. You can pass either true or a configuration object.

imageminWrapper({
  plugins: {
    jpegoptim: true,
    optipng: true,
    svgo: true
  }
})
imageminWrapper({
  plugins: {
    jpegoptim: { ... },
    optipng: { ... },
    svgo: { ... }
  }
})

swallowUnchanged

Set this to true if you want the plugin to emit only changed files back into the stream.

imageminWrapper({
  swallowUnchanged: true
})

Dependencies

This package requires "imagemin".

Optional dependencies

This package can require "imagemin-jpegoptim", "imagemin-optipng" and "imagemin-svgo".


Copyright (c) 2019 Elco Klingen. MIT License.

2.0.1

4 years ago

2.0.0

4 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago