Reputation: 51
I am trying to build my sass with gulp sass and i get the error:
The following tasks did not complete: build, clean Did you forget to signal async completion?
gulp.task('clean', function() { return del.sync('dist'); });
gulp.task('build', gulp.series('clean', 'imagemin', 'sass', 'js', function(done) {
var buildMain = gulp.src([
'app/*.html',
'app/.htaccess'
]).pipe(gulp.dest('dist'));
var buildCss = gulp.src([
'app/css/main.min.css'
])
.pipe(gulp.dest('dist/css'));
var buildJs = gulp.src([
'app/js/scripts.min.js'
])
.pipe(gulp.dest('dist/js'));
var buildFonts = gulp.src([
'app/fonts/**/*'
])
.pipe(gulp.dest('dist/fonts'));
done(); }));
Upvotes: 5
Views: 13100
Reputation: 45
For the latest version of gulp you can use:
export const build = series(clean, imagemin, sass, js);
No additional wrapper function needed.
https://gulpjs.com/docs/en/api/series/#usage
Upvotes: 3
Reputation: 51
Like Sven Schoenung said in this question:
This is a much more fitting mechanism for your use case. Note that most of the time you won't have to create the Promise object yourself, it will usually be provided by a package (e.g. the frequently used del package returns a Promise).
I tried this approach and for me is working. The code will be:
gulp.task('clean:dist', function (resolve) {
del.sync('dist');
resolve();
})
Upvotes: 5