Gulp clean / del behaviour has changed
Asked Answered
C

1

6

Part of my gulpfile.js

const del = require('del');
const chrome_dir = 'build/chrome';
const ff_dir = 'build/firefox';

gulp.task('clean', function (cb) {
    del([chrome_dir, ff_dir], cb);
});


gulp.task('default', ['clean'], function () {
    gulp.start('build packages', 'JS Backend', 'i18n', 'ExtRes', 'styles', 'JS Content', 'templates');
});

worked well.
Then I installed a new system and there maybe got new versions of gulp and del and whatever.
Now gulp stops after cleaning.
I can call all tasks manually, that's working fine.
Could only be a change in the behaviour of del...

How can I fix this?

Coke answered 16/9, 2015 at 9:46 Comment(2)
what is the current version of del & gulpNormally
gulp: 3.9.0, del: 2.0.2Coke
D
9

One of the most important changes on v2 is that now it returns a Promise instead of using a callback to handle async. From del documentation.

You simply have to re-write this part of your code:

gulp.task('clean', function (cb) {
    del([chrome_dir, ff_dir], cb);
});

like this:

gulp.task('clean', function () {
    return del([chrome_dir, ff_dir]);
});
Difficult answered 16/9, 2015 at 16:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.