Trying to create a gulp task that will transfer a bunch of files from different folders through LESS, and then output them to a folder based on the original source. Consider this folder structure:
Project +-- /Module_A | +- /less | | +- a.less | +- a.css | +-- /Module_B +- /less | +- b.less +- b.css
Here is my gulpfile:
var gulp = require('gulp'); var gutil = require('gulp-util'); var less = require('gulp-less'); gulp.task('compileLess', function () { gulp.src('./*/less/*.less') .pipe(less()) .pipe(gulp.dest( ??? )); }); gulp.task('default', ['compileLess']);
I know that gulp.dest () expects the path to be passed, but in my example, the path will be different depending on the source file. So, how can I get the path from the source, change it, and then pass it to gulp.dest ()?
Or am I mistaken about this?
Adam Mar 07 '14 at 3:41 a.m. 2014-03-07 03:41
source share