Package Exports
- grunt-imageoptim
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (grunt-imageoptim) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
grunt-imageoptim
A Grunt task to control ImageOptim, ImageAlpha and JPEGmini for Mac so lossless optimisation of images can be part of your automated build process.
Getting Started
This plugin requires Grunt ~0.4.1 and installs ImageOptim-CLI ~1.4.1 locally.
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-imageoptim --save-devOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-imageoptim');Example Gruntfile
imageoptim: {
// these paths should match directories
files: [
'path/to/img/dir',
'path/to/some/other/img/dir'
],
options: {
// also run images through ImageAlpha.app before ImageOptim.app
imageAlpha: true,
// also run images through JPEGmini.app after ImageOptim.app
jpegMini: true,
// quit all apps after optimisation
quitAfter: true
}
}