Minify css with clean-css.

This commit is contained in:
XhmikosR 2013-09-18 08:45:38 +03:00
parent b5613c9af5
commit fdc5d1dc34
4 changed files with 22 additions and 17 deletions

View File

@ -82,6 +82,21 @@ module.exports = function (grunt) {
}
},
cssmin: {
compress: {
options: {
banner: '<%= banner %>',
keepSpecialComments: 0,
report: 'min',
selectorsMergeMode: 'ie8'
},
files: {
'dist/css/<%= pkg.name %>.min.css': '<%= recess.bootstrap.dest %>',
'dist/css/<%= pkg.name %>-theme.min.css': '<%= recess.theme.dest %>'
}
}
},
uglify: {
options: {
banner: '<%= banner %>',
@ -112,23 +127,9 @@ module.exports = function (grunt) {
src: ['less/bootstrap.less'],
dest: 'dist/css/<%= pkg.name %>.css'
},
min: {
options: {
compress: true
},
src: ['less/bootstrap.less'],
dest: 'dist/css/<%= pkg.name %>.min.css'
},
theme: {
src: ['less/theme.less'],
dest: 'dist/css/<%= pkg.name %>-theme.css'
},
theme_min: {
options: {
compress: true
},
src: ['less/theme.less'],
dest: 'dist/css/<%= pkg.name %>-theme.min.css'
}
},
@ -300,6 +301,7 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-uglify');
@ -327,7 +329,7 @@ module.exports = function (grunt) {
grunt.registerTask('dist-js', ['concat', 'uglify']);
// CSS distribution task.
grunt.registerTask('dist-css', ['recess']);
grunt.registerTask('dist-css', ['recess', 'cssmin']);
// Fonts distribution task.
grunt.registerTask('dist-fonts', ['copy']);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -26,6 +26,7 @@
, "grunt-contrib-concat": "~0.3.0"
, "grunt-contrib-connect": "~0.5.0"
, "grunt-contrib-copy": "~0.4.1"
, "grunt-contrib-cssmin": "~0.7.0"
, "grunt-contrib-jshint": "~0.7.0"
, "grunt-contrib-qunit": "~0.3.0"
, "grunt-contrib-uglify": "~0.2.4"