Package Exports
- gulp-tinypng-unlimited
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gulp-tinypng-unlimited) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
gulp-tinypng-unlimited
Use tinypng to compress the gulp plugins of png and jpg.
Install
$ npm install --save-dev gulp-tinypng-unlimitedUsage
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(), package.name + '-cache'), // 缓存存放的目录
filterRule: /\.(png|jpg|jpeg)$/i, // 压缩的过滤规则
outputErrorFilePath: true, // 是否输出错误文件的路径
outputErrorFiles: false, // 是否依然将错误文件输出
}))
.pipe(gulp.dest('./dist'));
});Changelog
2018-4-25 16:25:04
- 完成1.0.0版本的功能
- 添加简单的测试
- 提交npm