I had the same issues trying to compile the Bootstrap CSS. My simplified solution ended up looking like:
// Compiles LESS > CSS
gulp.task('build-less', function(){
return gulp.src('styles.less')
.pipe(less())
.pipe(gulp.dest('./source/css'));
});
and my styles.less file included the import to the bootstrap.less
. I noticed that if the bootstrap less files were included in the gulp.src()
path it would errors.
My styles.less
:
@import "../lib/bootstrap/less/bootstrap.less";
@body-bg: red; // test background color