grunt-cwebp
v3.0.3
Published
Convert JPG and PNG images to WebP with grunt task.
Downloads
1,833
Readme
grunt-cwebp
Convert JPG and PNG images to WebP with grunt task.
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
.