import gulp from "gulp"
import less from "gulp-less"
import sourcemaps from "gulp-sourcemaps"

const paths = {
  styles: {
    src: "less/**/*.less",
    entry: "less/les-oublies.less",
    dest: "css/",
  },
}

export function styles() {
  return gulp.src(paths.styles.entry)
    .pipe(sourcemaps.init())
    .pipe(less())
    .pipe(sourcemaps.write("."))
    .pipe(gulp.dest(paths.styles.dest))
}

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

export const build = gulp.series(styles)
export default gulp.series(build, watch)
