node package manager
Loosely couple your services. Use Orgs to version and reuse your code. Create a free org »

fis3-optimizer-imagemin

fis3-optimizer-imagemin

a image optimizer plugin of fis3 based on imagemin

styled with prettier npm npm npm

packages

all in one https://www.npmjs.com/package/fis3-optimizer-imagemin

standalone https://www.npmjs.com/browse/keyword/fis3-optimizer-imagemin

install

$ npm i -g fis3-optimizer-imagemin

options

var config = {
  FILE_EXT: {
    PLUGIN_NAME: OPTIONS
  }
}
FILE_EXT = .png, .png8, .jpg, .jpeg, .gif, .svg ...
PLUGIN_NAME = a imagemin supported plugin without prefix `image-`
OPTIONS = options for current plugin

default options

notice: this might change in future

{
  ".gif": {
    "gifsicle": {
      "interlaced": true
    }
  },
  ".jpg": {
    "mozjpeg": {
    }
  },
  ".png": {
    "upng": {
    }
  },
  ".svg": {
    "svgo": {
      "plugins": [
        {
          "removeViewBox": false
        }
      ]
    }
  },
  ".webp": {
    "webp": {
    }
  }
}

more options:

https://www.npmjs.com/package/imagemin-upng

https://www.npmjs.com/package/imagemin-mozjpeg

https://www.npmjs.com/package/imagemin-gifsicle

https://www.npmjs.com/package/imagemin-webp

https://www.npmjs.com/package/imagemin-svgo

usage

// fis-conf.js
 
var options = {} // your options
 
fis.match('::image', {
  optimizer: fis.plugin('imagemin', options)
})

links

fis3: http://fis.baidu.com/

imagemin: https://github.com/imagemin/imagemin

preinstalled imagemin plugins

imagemin-upng@^1.2.2: https://www.npmjs.com/package/imagemin-upng

imagemin-mozjpeg@^6.0.0: https://www.npmjs.com/package/imagemin-mozjpeg

imagemin-gifsicle@^5.2.0: https://www.npmjs.com/package/imagemin-gifsicle

imagemin-webp@^4.0.0: https://www.npmjs.com/package/imagemin-webp

imagemin-svgo@^6.0.0: https://www.npmjs.com/package/imagemin-svgo

license

MIT © fisker Cheung