/gulp-webp

Convert images to WebP

Primary LanguageJavaScriptMIT LicenseMIT

gulp-webp Build Status

Convert images to WebP

Supports PNG, JPEG, TIFF, WebP.

Install

$ npm install --save-dev gulp-webp

Usage

var gulp = require('gulp');
var webp = require('gulp-webp');

gulp.task('default', function () {
	return gulp.src('src/image.jpg')
		.pipe(webp())
		.pipe(gulp.dest('dist'));
});

API

Unsupported files are ignored.

webp(options)

options

quality

Type: number
Default: 100
Min: 0
Max: 100

lossless

Type: boolean
Default: false

append .webp extension. By default extension is replaced.

Type: boolean
Default: false

License

MIT © Sindre Sorhus