grunt-contrib-cssmin
Advanced tools
Comparing version 0.6.0 to 0.6.1
# Usage Examples | ||
## Combine two files into one output file | ||
```js | ||
cssmin: { | ||
compress: { | ||
combine: { | ||
files: { | ||
'path/to/output.css': ['path/to/input_one.css', 'path/to/input_two.css'] | ||
} | ||
}, | ||
with_banner: { | ||
} | ||
} | ||
``` | ||
## Add a banner | ||
```js | ||
cssmin: { | ||
add_banner: { | ||
options: { | ||
@@ -20,1 +28,14 @@ banner: '/* My minified css file */' | ||
``` | ||
## Minify all contents of a release directory and add a `.min.css` extension | ||
```js | ||
cssmin: { | ||
minify: { | ||
expand: true, | ||
cwd: 'release/css/', | ||
src: ['*.css', '!*.min.css'], | ||
dest: 'release/css/', | ||
ext: '.min.css' | ||
} | ||
} | ||
``` |
@@ -58,2 +58,7 @@ /* | ||
} | ||
}, | ||
inline_import: { | ||
files: { | ||
'tmp/inline_import.css': ['test/fixtures/input_inline_import.css', 'test/fixtures/inner/input_inline_import.css'] | ||
} | ||
} | ||
@@ -60,0 +65,0 @@ }, |
{ | ||
"name": "grunt-contrib-cssmin", | ||
"description": "Compress CSS files.", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"homepage": "https://github.com/gruntjs/grunt-contrib-cssmin", | ||
@@ -31,3 +31,3 @@ "author": { | ||
"dependencies": { | ||
"clean-css": "~1.0.0", | ||
"clean-css": "~1.0.4", | ||
"grunt-lib-contrib": "~0.6.0" | ||
@@ -34,0 +34,0 @@ }, |
@@ -64,10 +64,18 @@ # grunt-contrib-cssmin [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-contrib-cssmin.png?branch=master)](http://travis-ci.org/gruntjs/grunt-contrib-cssmin) | ||
#### Combine two files into one output file | ||
```js | ||
cssmin: { | ||
compress: { | ||
combine: { | ||
files: { | ||
'path/to/output.css': ['path/to/input_one.css', 'path/to/input_two.css'] | ||
} | ||
}, | ||
with_banner: { | ||
} | ||
} | ||
``` | ||
#### Add a banner | ||
```js | ||
cssmin: { | ||
add_banner: { | ||
options: { | ||
@@ -83,5 +91,19 @@ banner: '/* My minified css file */' | ||
#### Minify all contents of a release directory and add a `.min.css` extension | ||
```js | ||
cssmin: { | ||
minify: { | ||
expand: true, | ||
cwd: 'release/css/', | ||
src: ['*.css', '!*.min.css'], | ||
dest: 'release/css/', | ||
ext: '.min.css' | ||
} | ||
} | ||
``` | ||
## Release History | ||
* 2013-05-25 v0.6.1 Support import in-lining vis clean-css ~1.0.4. | ||
* 2013-04-05 v0.6.0 Update clean-css dependency to ~1.0.0 | ||
@@ -103,2 +125,2 @@ * 2013-03-14 v0.5.0 Support for 'report' option (false by default) | ||
*This file was generated on Fri Apr 05 2013 09:03:50.* | ||
*This file was generated on Sat May 25 2013 18:52:13.* |
@@ -13,2 +13,3 @@ /* | ||
var helper = require('grunt-lib-contrib').init(grunt); | ||
var path = require('path'); | ||
@@ -20,3 +21,3 @@ grunt.registerMultiTask('cssmin', 'Minify CSS files', function() { | ||
this.files.forEach(function(f) { | ||
var max = f.src.filter(function(filepath) { | ||
var valid = f.src.filter(function(filepath) { | ||
// Warn on and remove invalid source files (if nonull was set). | ||
@@ -29,7 +30,12 @@ if (!grunt.file.exists(filepath)) { | ||
} | ||
}) | ||
}); | ||
var max = valid | ||
.map(grunt.file.read) | ||
.join(grunt.util.normalizelf(grunt.util.linefeed)); | ||
var min = valid.map(function(f) { | ||
options.relativeTo = path.dirname(f); | ||
return minifyCSS(grunt.file.read(f), options); | ||
}) | ||
.join(''); | ||
var min = minifyCSS(max, options); | ||
if (min.length < 1) { | ||
@@ -36,0 +42,0 @@ grunt.log.warn('Destination not written because minified CSS was empty.'); |
@@ -39,3 +39,12 @@ 'use strict'; | ||
test.done(); | ||
}, | ||
imports: function(test) { | ||
test.expect(1); | ||
var expect = grunt.file.read('test/expected/inline_import.css'); | ||
var result = grunt.file.read('tmp/inline_import.css'); | ||
test.equal(expect, result, 'should inline @import'); | ||
test.done(); | ||
} | ||
}; | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16238
27
199
124
Updatedclean-css@~1.0.4