Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lvjiaxuan/gulp-tiny-imgmin
gulp图片压缩插件
https://github.com/lvjiaxuan/gulp-tiny-imgmin
Last synced: about 1 month ago
JSON representation
gulp图片压缩插件
- Host: GitHub
- URL: https://github.com/lvjiaxuan/gulp-tiny-imgmin
- Owner: lvjiaxuan
- License: mit
- Created: 2019-09-25T07:24:16.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T11:19:34.000Z (almost 2 years ago)
- Last Synced: 2024-08-10T19:23:09.712Z (5 months ago)
- Language: TypeScript
- Size: 566 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
该图片压缩插件综合了熊猫压缩和`imagemin`,压缩时会根据熊猫key、网络情况、缓存等不同情况选择压缩方式。
# usage
```js
exports.tiny = () => gulp.src('./test/*')
.pipe(tiny({
key: 'tiny api key'
})).pipe(gulp.dest('./test/tinied'));
```# options
| 名称 | 类型 | 默认值 | 说明 |
| -------- | ------- | --------------------- | ------------------------------------------------------------ |
| key | string | imagemin | 非必填,key不填(为空)或为imagemin时,选择使用imagemin进行压缩 |
| tinyTag | string | `''` | 非必填,为压缩后的图片命名追加名称 |
| minSize | number | 4096 | 非必填,默认为`vue-cli`对图片处理的最小大小 |
| verbose | boolean | false | 非必填,是否打印更多的信息 |
| jsonDest | string | `./.gulp-tiny-cache/` | 非必填,图片名称json数组,一般配合预加组件使用(连带宣传:[vue-imgs-preload](https://github.com/lvjiaxuan/vue-imgs-preload)) |# note
- 缓存时,源文件和压缩图片根据源文件名联系,所以改了源文件名不能走缓存