const gulp = require('gulp');
const less = require('gulp-less');
const sourcemaps = require('gulp-sourcemaps');

const paths = {
  styles: {
    src: 'less/**/*.less',
    dest: 'styles/'
  }
};

function styles() {
  return gulp.src('less/mournblade-cyd2.less')
    .pipe(sourcemaps.init())
    .pipe(less())
    .pipe(sourcemaps.write('.'))
    .pipe(gulp.dest(paths.styles.dest));
}

function watchFiles() {
  gulp.watch(paths.styles.src, styles);
}

const build = gulp.series(styles);
const watch = gulp.series(build, watchFiles);

exports.styles = styles;
exports.build = build;
exports.watch = watch;
exports.default = build;
