I want to have a gulp task in Visual Studio Code which watches all files in a folder called less with the extension .less. When found, a task must compile the less files to a folder called css on the same level as the less folder.
Current code:
gulp.task('less', function() {
gulp.src('less/*.less',{ cwd:'..' })
.pipe(less())
.pipe(gulp.dest( 'css' ), { cwd:'..' });
});
gulp.task('default', function() {
gulp.watch('./**/less/*.less', ['less']);
});
What I want:
- x
- y
- less
- style.less
- css
- style.css
What above code does:
- x
- y
- less
- style.less
- css
- y
- less
- style.css
- less
- y
I had this working when being specific in the path, but the problem is that i've less folders on multiple levels. How can I solve this?