gulp-cssnano
Minify CSS with cssnano.
With npm do:
npm install gulp-cssnano --save-dev
var gulp = require('gulp');
var nano = require('gulp-cssnano');
gulp.task('default', function() {
return gulp.src('./main.css')
.pipe(nano())
.pipe(gulp.dest('./out'));
});
gulp-cssnano supports gulp-sourcemaps:
var gulp = require('gulp');
var nano = require('gulp-cssnano');
var sourcemaps = require('gulp-sourcemaps');
gulp.task('default', function () {
return gulp.src('main.css')
.pipe(sourcemaps.init())
.pipe(nano())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('./out'));
});
Pull requests are welcome. If you add functionality, then please add unit tests to cover it.
MIT © Ben Briggs