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(), packageConfig.name + '-cache'), // 缓存存放的目录
outputErrorLog: true, // 打印错误日志
outputErrorFiles: false, // 仍然将错误文件输出
}))
.pipe(gulp.dest('./dist'));
});Changelog
2018-5-2 18:22:26
- 修改缓存方法
- 修改调用参数
2018-4-25 16:25:04
- 完成1.0.0版本的功能
- 添加简单的测试
- 提交npm