Skip to content

Use tinypng to compress the gulp plugins of png and jpg.

License

Notifications You must be signed in to change notification settings

ystrdy/gulp-tinypng-unlimited

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-tinypng-unlimited

Use tinypng to compress the gulp plugins of png and jpg.

Install

$ npm install --save-dev gulp-tinypng-unlimited

Usage

const gulp = require('gulp');
const tinypng = require('gulp-tinypng-unlimited');

gulp.task('default', () => {
  return gulp.src('./img/**/*.@(png|jpg|jpeg)')
    .pipe(tinypng())
    .pipe(gulp.dest('./dist'));
});

API

const gulp = require('gulp');
const tinypng = require('gulp-tinypng-unlimited');

gulp.task('default', () => {
  return gulp.src('./img/**/*.@(png|jpg|jpeg)')
    .pipe(tinypng({
      cache: true,                        // 开启缓存
      cachePath: path.join(os.tmpdir(), packageConfig.name + '-cache'),                    // 缓存存放的目录
      outputErrorLog: true,               // 打印错误日志
      outputErrorFiles: false,            // 仍然将错误文件输出
    }))
    .pipe(gulp.dest('./dist'));
});

Changelog

2018-5-2 / 1.0.3

  1. 修改缓存方法
  2. 修改调用参数

2018-4-25 / 1.0.0

  1. 完成1.0.0版本的功能
  2. 添加简单的测试
  3. 提交npm

About

Use tinypng to compress the gulp plugins of png and jpg.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published