0.19.0 • Published 2 months ago

@hidoo/gulp-plugin-webp v0.19.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 months ago

@hidoo/gulp-plugin-webp

Plugin that generate webp for gulp.

Installation

$ npm install --save-dev gulp@next @hidoo/gulp-plugin-webp

Usage

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

webp

return webp.

Parameters

  • options Object option (optional, default {})

    • options.append Boolean append webp or not (optional, default true)
    • options.keepExtname Boolean keep extname or not (optional, default true)
    • options.verbose Boolean out log or not (optional, default false)

Examples

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

$ pnpm test

License

MIT