Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

About

Convert JPG and PNG images to WebP with grunt task.

Resources

Sponsor this project

 

Packages

No packages published