How to compress the styles through the csso?

How to use csso to minifirewall all files .css from the folder and combine them into one file?

var csso = require('csso');

var compressedCss = csso.minify('.test { color: #ff0000; }').css;


In the example indicated specific styles, but how to replace them with files?
July 8th 19 at 15:23
2 answers
July 8th 19 at 15:25
Solution
https://www.npmjs.com/package/gulp-csso

var gulp = require('gulp');
var csso = require('gulp-csso');

gulp.task('default', function () {
 return gulp.src('./main.css')
.pipe(csso())
.pipe(gulp.dest('./out'));
});

gulp.task('development', function () {
 return gulp.src('./main.css')
.pipe(csso({
 restructure: false,
 sourceMap: true,
 debug: true
}))
.pipe(gulp.dest('./out'));
});
July 8th 19 at 15:27

Find more questions by tags CSS