簡體   English   中英

大吃一驚忽略依賴

[英]Gulp ignoring dependency

我試圖弄清楚為什么我的gulp任務沒有按我想要的順序運行,這是代碼;

gulp.task('styles', ['clean-styles'], function () {
    log('Compiling Less --> CSS');

return gulp
    .src(config.less)
    .pipe($.less())
    .pipe($.autoprefixer({browsers: ['last 2 version', '> 5%']}))
    .pipe(gulp.dest(config.temp));
});

gulp.task('clean-styles', function (done) {
    var files = config.temp + '**/*.css';
    clean(files, done);
});

function clean(path, done) {
    log('Cleaning: ' + $.util.colors.blue(path));
    del(path, done);
}

當我運行“ gulp樣式”時,它僅運行“清潔樣式”功能,完成清潔任務后應運行“樣式”功能。

簡而言之,問題是;

為什么我的“樣式”任務在執行時被忽略?

提前致謝

試試這個:

//An array of tasks to be executed and completed before your task will run.
gulp.task('clean-styles', ['styles'], function() {
  // Do stuff
});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM