How to run Gulp tasks sequentially one after the other

前端 未结 14 762
眼角桃花
眼角桃花 2020-11-22 13:00

in the snippet like this:

gulp.task \"coffee\", ->
    gulp.src(\"src/server/**/*.coffee\")
        .pipe(coffee {bare: true}).on(\"error\",gutil.log)
           


        
14条回答
  •  情歌与酒
    2020-11-22 13:16

    I was having this exact same problem and the solution turned out to be pretty easy for me. Basically change your code to the following and it should work. NOTE: the return before gulp.src made all the difference for me.

    gulp.task "coffee", ->
        return gulp.src("src/server/**/*.coffee")
            .pipe(coffee {bare: true}).on("error",gutil.log)
            .pipe(gulp.dest "bin")
    
    gulp.task "clean",->
        return gulp.src("bin", {read:false})
            .pipe clean
                force:true
    
    gulp.task 'develop',['clean','coffee'], ->
        console.log "run something else"
    

提交回复
热议问题