JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 461
  • Score
    100M100P100Q100715F

Make ImageOptim and ImageAlpha part of your automated build process

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 and ImageAlpha so lossless optimisation of images can be part of your automated build process.

Version 1.4 will soon also bring support for automating JPEGmini for Mac.

Getting Started

This plugin requires Grunt ~0.4.1 and ImageOptim-CLI ~0.3.2.

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-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-imageoptim');

Example Gruntfile

imageoptim: {
  files: [
    'path/to/img/dir',
    'path/to/some/other/img/dir'
  ],
  options: {
    // also run images through ImageAlpha.app before ImageOptim.app
    imageAlpha: true,
    // quit all apps after optimisation
    quitAfter: true
  }
}