const gulp = require('gulp');
const minifyCSS = require('gulp-csso');
const concat = require('gulp-concat');
const rename = require('gulp-rename');
const cleanCSS = require('gulp-clean-css');
const autoprefixer = require('gulp-autoprefixer');

var CSSDEST = 'static/'

gulp.task('default', defaultTask);

function defaultTask(done) {
  return gulp.src('src/css/*.css')
             .pipe(concat('default.css'))
             .pipe(cleanCSS({format: 'beautify'}))
             .pipe(autoprefixer({
               browsers: ['last 4 versions'],
               cascade: false
             }))
             .pipe(gulp.dest(CSSDEST))
             .pipe(cleanCSS())
             .pipe(rename({ extname: '.min.css' }))
             .pipe(gulp.dest(CSSDEST))
}
