const gulp    = require('gulp')
const less    = require('gulp-less')
const postcss = require('gulp-postcss')
const autoprefixer = require('autoprefixer')

const LESS_SRC  = './less/fvtt-oath-hammer.less'
const CSS_DEST  = './css'

function buildCss() {
  return gulp.src(LESS_SRC)
    .pipe(less())
    .pipe(postcss([autoprefixer]))
    .pipe(gulp.dest(CSS_DEST))
}

function watchCss() {
  gulp.watch('./less/**/*.less', buildCss)
}

gulp.task('css', buildCss)
gulp.task('watch', watchCss)
gulp.task('default', buildCss)
