gulp-clean-css npm package of node.js


Overview

This is a plugin for gulp which is used to minify the css files.

Code


													
var gulp = require('gulp');
var cleanCss = require('gulp-clean-css');

// name of the task is :  gulp.min.css 
gulp.task('mincss', function() {			
  return gulp.src('source/*.css')				//add your custom source here
    .pipe(cleanCss({compatibility: 'ie8'}))
    .pipe(gulp.dest('./css'));					//destination folder comes here
});
													
												

Run

  • Now run the snippet using the following command :
    													
    $gulp	mincss