gulp-css-condense
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