Closed akanshgulati closed 3 years ago
@akanshgulati Can you post a full example? This library supports any version of gulp - plugins had no breaking changes between 3 and 4. You probably updated one of your other dependencies (like your version of less) that is causing the issue.
I was getting signal async completion errors when following the documentation with gulp 4. Here's what I had to do:
gulp.task('styles', function(done) {
gulp.src('./less/**/*.less')
.pipe(less({
paths: [ path.join(__dirname, 'less', 'includes') ]
}))
.pipe(gulp.dest('./css'));
done() // Signal async completion
})
Here's my entire gulpfile for getting watching working with gulp 4. I'm new to gulp but it's hard to find documentation for getting gulp-less watching on gulp 4 so hopefully this is helpful:
const { watch, dest, src } = require('gulp');
const less = require('gulp-less');
const path = require('path');
// This is the new way with gulp 4 but there is less documentation for it.
function compile(cb) {
return src('./less/**/*.less')
.pipe(less({
paths: [ path.join(__dirname, 'less', 'includes') ]
}))
.pipe(dest('./css'));
done();
cb();
}
exports.default = function() {
watch('./less/**/*.less', compile);
}
3.0.5
to4.0.1
, I found files started giving errors having extension less imports@stevelacy Please help.