grunt-cwebp

3.0.3 • Public • Published

grunt-cwebp

Convert JPG and PNG images to WebP with grunt task.

Build Status NPM version Dependency Status devDependency Status

Install

$ npm install --save-dev grunt-cwebp

Usage

Please see following gruntfile.js example.

module.exports = function (grunt) {
  grunt.initConfig({
    cwebp: {
      static: {
        files: {
          'dist/img-png.webp': 'src/img.png',
          'dist/img-jpg.webp': 'src/img.jpg',
          'dist/img-gif.webp': 'src/img.gif'
        }
      },
      dynamic: {
        options: {
          q: 50
        },
        files: [{
          expand: true,
          cwd: 'src/',
          src: ['**/*.{png,jpg,gif}'],
          dest: 'dist/'
        }]
      }
    }
  });
 
  grunt.loadNpmTasks('grunt-cwebp');
};

You can also pass the options like q: 50.

License

MIT © Shogo Sensui

Readme

Keywords

Package Sidebar

Install

npm i grunt-cwebp

Weekly Downloads

868

Version

3.0.3

License

MIT

Unpacked Size

206 kB

Total Files

9

Last publish

Collaborators

  • 1000ch