I want to apply a Gulp watcher to my LESS files so Gulp will create css files whenever a LESS file gets saved.
How can I do this? It doesn't seem to be correct/sufficient to write something like this:
var gulp = require("gulp");
var moreLess = require("gulp-more-less");
var concatCss = require("gulp-concat-css");
var lessInFolder = "./Less/**/*.less";
gulp.task("less", function ()
{
gulp.src(lessInFolder).pipe(moreless()).pipe(concatCss()).pipe(gulp.dest("./css"));
});
gulp.watch(lessInFolder, ["less"]);
Create a dedicated task for the watch function :
gulp.task('default', function () {
gulp.watch(lessInFolder, ['less']);
});
then use the visual studio Task Runner Explorer
to execute (or bind) that task.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With