gulp-css-condense
![Dependency Status](https://camo.githubusercontent.com/0d5b36227e3fd823472a26d643ed75a82b16fcbb9284e46b7cbd319d5aa48296/68747470733a2f2f67656d6e617369756d2e636f6d2f62656e2d65622f67756c702d6373732d636f6e64656e73652e737667)
A gulp plugin for the CSS compressor that shows no mercy.
If you have any difficulties with the output of this plugin, please use the css-condense tracker.
Install via npm:
npm install gulp-css-condense --save-dev
var gulp = require('gulp');
var cssc = require('gulp-css-condense');
gulp.task('default', function() {
return gulp.src('./main.css')
.pipe(cssc())
.pipe(gulp.dest('./out'));
});
Type: Boolean
If this is set to true
, css-condense will not perform optimisations such as
selector and declaration consolidation (the docs have more information).
Note that you can also choose which optimisations that you deem to be fit for
your build by passing them individually:
var gulp = require('gulp');
var cssc = require('gulp-css-condense');
gulp.task('default', function() {
return gulp.src('./main.css')
.pipe(cssc({
consolidateViaDeclarations: true,
consolidateViaSelectors: false,
consolidateMediaQueries: true
}))
.pipe(gulp.dest('./out'));
});
options.safe
is just a convenience for specifying all of the above options as
false
.
Pull requests are welcome. If you add functionality, then please add unit tests to cover it.
MIT © Ben Briggs