- Does some neat tricks like removing spaces, subbing equivalent values (transparent for rgba 0s), using single quotes, etc.
- Didn't strip comments (at least I didn't find the option in Grunt plugin).
- A bit weird that the example doesn't allow the file to be renamed.
- Running it through cssmin first (to remove comments), didn't yield significant savings (< 1KB change)
- Might be useful for really large CSS files.
Created
July 3, 2014 02:17
-
-
Save naganowl/8c0f761745cd656ed28e to your computer and use it in GitHub Desktop.
Notes on using grunt-cssshrink
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (grunt) -> | |
grunt.initConfig | |
pkg: grunt.file.readJSON 'package.json' | |
concat: | |
# Stylus doesn't concat well with Bootstrap. | |
css: | |
src: [ | |
'vendor/bower/bootstrap/dist/css/bootstrap.css' | |
'public/stylesheets/application.css' | |
] | |
dest: 'public/stylesheets/application.min.css' | |
cssmin: | |
compile: | |
options: | |
keepSpecialComments: 0 | |
src: [ | |
'vendor/bower/bootstrap/dist/css/bootstrap.css' | |
'public/stylesheets/application.css' | |
] | |
dest: 'public/stylesheets/application.min.css' | |
cssshrink: | |
compile: | |
files: | |
'public/stylesheets': [ | |
'public/stylesheets/application.min.css' | |
] | |
grunt.registerTask 'build', [ | |
'cssmin' | |
'cssshrink' | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment