@hidoo/gulp-plugin-webp
Version:
Plugin that generate webp for gulp.
72 lines (49 loc) • 1.62 kB
Markdown
# @hidoo/gulp-plugin-webp
> Plugin that generate webp for gulp.
## Installation
```sh
$ npm install --save-dev gulp@next @hidoo/gulp-plugin-webp
```
## Usage
```js
import { src, dest, task } from 'gulp';
import webp from '@hidoo/gulp-plugin-webp';
task('webp', () =>
src('/path/to/src').pipe(webp()).pipe(dest('/path/to/dest'))
);
```
## API
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
### webp
return webp.
#### Parameters
- `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** option (optional, default `{}`)
- `options.append` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** append webp or not (optional, default `true`)
- `options.keepExtname` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** keep extname or not (optional, default `true`)
- `options.verbose` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** out log or not (optional, default `false`)
#### Examples
```javascript
import { src, dest, task } from 'gulp';
import webp from '@hidoo/gulp-plugin-webp';
task('webp', () =>
src('/path/to/src')
.pipe(
webp({
// this plugin options
append: false,
keepExtname: false,
verbose: true,
// specify imagemin-webp options
quality: 100
})
)
.pipe(dest('/path/to/dest'))
);
```
Returns **DestroyableTransform** 
## Test
```sh
$ pnpm test
```
## License
MIT