0.0.2 • Published 7 years ago

mako-imagemin v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

mako-imagemin

A plugin for compressing images with imagemin.

npm version npm dependencies npm dev dependencies

Purpose

Uses imagemin to compress file.contents for each configured image type. Configuration maps file types to plugins that must be installed separately by the end-user.

Since this plugin operates on raw buffers in file.contents, it is assumed that you are loading those files into via a plugin like mako-buffer.

API

imagemin(plugins)

The plugins parameter is an array of objects, and each item is an object with the following properties:

  • extensions a list of file extensions for this particular batch of plugins
  • use an array of imagemin plugin plugins to load

Below is an example .makorc that configures svg compression:

{
  "plugins": [
    [ "mako-buffer", [ "svg" ] ],
    [
      "mako-imagemin", [
        { "extensions": "svg", "use": [ "imagemin-svgo" ] }
      ]
    ]
  ]
}