本文介紹了如何一個接一個地依次運行 Gulp 任務的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
限時送ChatGPT賬號..
在這樣的片段中:
gulp.task "coffee", ->
gulp.src("src/server/**/*.coffee")
.pipe(coffee {bare: true}).on("error",gutil.log)
.pipe(gulp.dest "bin")
gulp.task "clean",->
gulp.src("bin", {read:false})
.pipe clean
force:true
gulp.task 'develop',['clean','coffee'], ->
console.log "run something else"
在 develop
任務中,我想運行 clean
并在完成后運行 coffee
,完成后運行其他內容.但我無法弄清楚.這塊不行.請指教.
In develop
task I want to run clean
and after it's done, run coffee
and when that's done, run something else. But I can't figure that out. This piece doesn't work. Please advise.
推薦答案
它還沒有正式發布,但是即將推出的 Gulp 4.0 讓您可以輕松地使用 gulp.series 執行同步任務.你可以這樣做:
It's not an official release yet, but the coming up Gulp 4.0 lets you easily do synchronous tasks with gulp.series. You can simply do it like this:
gulp.task('develop', gulp.series('clean', 'coffee'))
我找到了一篇很好的博客文章,介紹了如何升級和使用這些簡潔的功能:通過示例遷移到 gulp 4
I found a good blog post introducing how to upgrade and make a use of those neat features: migrating to gulp 4 by example
這篇關于如何一個接一個地依次運行 Gulp 任務的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!