var gulp = require('gulp');
var less = require('gulp-less');
// var watch = require('gulp-watch');

function compileless() {
  // return gulp.src('./less/styles.less')  // only compile the entry file
  return gulp.src('./less/*.less')
      // .pipe(plumber())
      .pipe(less({
        paths: ['./less/']
      }))
      // .pipe(prefix("last 8 version", "> 1%", "ie 8", "ie 7"), {cascade:true})
      .pipe(gulp.dest('./css/'));
      // .pipe(livereload());
};
gulp.task('watch', function() {
  gulp.watch('./less/*.less', compileless);  // Watch all the .less files, then run the less task
});

gulp.task('default', gulp.series('watch')); // Default will run the 'entry' watch task