Gulp clean / del behaviour has changed

后端 未结 1 414
盖世英雄少女心
盖世英雄少女心 2021-01-02 20:48

Part of my gulpfile.js

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

gulp.task(\'clean\', function (c         


        
相关标签:
1条回答
  • 2021-01-02 21:24

    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]);
    });
    
    0 讨论(0)
提交回复
热议问题