grunt-punypng
optimize images with punypng.
Getting Started
This plugin requires Grunt ~0.4.4
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-punypng --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt;
The "punypng" task
Overview
In your project's Gruntfile, add a section named punypng
to the data object passed into grunt.initConfig()
.
grunt;
Options
options.key
Type: key
用于识别punypng账户的key,注册punypny账户后可以获得(http://www.punypng.com/profile)
options.lossy
Type: lossy
Default value: 'true'
是否使用有损的压缩方式。推荐使用有损的压缩方式,有损的压缩是punypng的核心优势
options.rename
Type: lossy
Default value: 'true'
当lossy为true,重命名文件,去掉文件名中的".indexed"字符串;例如:banana.indexed.png 重命名为 banana.png。
options.limit
Type: limit
指定并发请求图片的数量。
Usage Examples
Default Options
grunt;