I have a scenario where a client of mine wants to drop LESS files into a src
directory (via FTP), and for them to be automatically outputted as CSS to a build
directory. For each LESS file, once its resultant CSS file is created, it should be removed from the src
directory. How can I do this with Gulp?
My current gulpfile.js
is:
var gulp = require("gulp");
var watch = require("gulp-watch");
var less = require("gulp-less");
watch({ glob: "./src/**/*.less" })
.pipe(less())
.pipe(gulp.dest("./build"));
This successfully detects new LESS files being dropped into the src
directory and outputs CSS files into build
. But it doesn't clean up the LESS files afterwards. :(