Compress CSS files.
This plugin requires Grunt
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-contrib-cssmin --save-dev
Run this task with the
grunt cssmin command.
Task targets, files and options may be specified according to the grunt Configuring tasks guide.
Files are compressed with clean-css. ### Options
Prefix the compressed source with the given banner, with a linebreak inbetween.
To keep or remove special comments, exposing the underlying option from clean-css..
'*' for keeping all (default),
1 for keeping first one,
0 for removing all.
Either do not report anything, report only minification result, or report minification and gzip results.
This is useful to see exactly how well clean-css is performing but using
'gzip' will make the task take 5-10x longer to complete.
Example ouput using
Original: 198444 bytes.Minified: 101615 bytes.Gzipped: 20084 bytes.
If the destination file is up to date (none of its sources have been updated since the last minification), it it skipped.
Example output using
true with a destination
main.min.js that is up to date:
File main.min.js is already up to date.
cssmin:combine:files:'path/to/output.css': 'path/to/input_one.css' 'path/to/input_two.css'
cssmin:add_banner:options:banner: '/* My minified css file */'files:'path/to/output.css': 'path/to/**/*.css'
cssmin:minify:expand: truecwd: 'release/css/'src: '*.css' '!*.min.css'dest: 'release/css/'ext: '.min.css'
Task submitted by Tim Branyen
This file was generated on Sat Nov 23 2013 10:48:27.