项目作者: ZhelinCheng

项目描述 :
tinypng压缩插件,支持缓存。
高级语言: JavaScript
项目地址: git://github.com/ZhelinCheng/gulp-tinypng-plugin.git
创建时间: 2017-10-17T07:32:55Z
项目社区:https://github.com/ZhelinCheng/gulp-tinypng-plugin

开源协议:MIT License

下载


gulp-tinypng-plugin

该插件增加了缓存功能,设置为cache : true,同时支持多个Key。

Minify PNG using tinypng
Reference resources gulp-tinypng

Install

Install with npm

  1. npm install --save-dev gulp-tinypng-plugin

Example

  1. var gulp = require('gulp');
  2. var tinypng = require('gulp-tinypng');
  3. gulp.task('tinypng', function () {
  4. gulp.src('src/**/*.png')
  5. .pipe(tinypng({
  6. //key : 'API_KEY'
  7. key : ['API_KEY1', 'API_KEY2''...'],
  8. cache : true
  9. }))
  10. .pipe(gulp.dest('compressed_images'));
  11. });

tinypng(options)

key: API_KEY(String || Array)

cache: Open cache

License

MIT