The companion Grunt plugin for ImageOptim-CLI, which automates batch optimisation of images with ImageOptim, ImageAlpha and JPEGmini for Mac.
From the root of your project, run
npm install grunt-imageoptim --save-dev
In future versions we plan to fully support Grunt's file pattern matching. Until then only processing of directories is supported (as opposed to arbitrary collections of files).
module.exports = function(grunt) {
grunt.initConfig({
imageoptim: {
files: ['public/image-directory'],
options: {
jpegMini: false,
imageAlpha: false,
quitAfter: false
}
}
});
grunt.loadNpmTasks('grunt-imageoptim');
};