|
1 bulan lalu | |
---|---|---|
.. | ||
docs | 1 bulan lalu | |
tasks | 1 bulan lalu | |
test | 1 bulan lalu | |
.jshintrc | 1 bulan lalu | |
.npmignore | 1 bulan lalu | |
.travis.yml | 1 bulan lalu | |
AUTHORS | 1 bulan lalu | |
CHANGELOG | 1 bulan lalu | |
CONTRIBUTING.md | 1 bulan lalu | |
Gruntfile.js | 1 bulan lalu | |
LICENSE-MIT | 1 bulan lalu | |
README.md | 1 bulan lalu | |
package.json | 1 bulan lalu |
Compress CSS files.
This plugin requires Grunt ~0.4.0
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
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-contrib-cssmin');
This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that you upgrade, but in case you can't please use v0.3.2.
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.
Type: String
Default: null
Prefix the compressed source with the given banner, with a linebreak inbetween.
Type: String
Number
Default: '*'
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.
Choices: false
, 'min'
, 'gzip'
Default: false
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 'gzip'
:
Original: 198444 bytes.
Minified: 101615 bytes.
Gzipped: 20084 bytes.
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']
}
}
}
.min.css
extensioncssmin: {
minify: {
expand: true,
cwd: 'release/css/',
src: ['*.css', '!*.min.css'],
dest: 'release/css/',
ext: '.min.css'
}
}
Task submitted by Tim Branyen
This file was generated on Sat May 25 2013 18:52:13.