Answer the question
In order to leave comments, you need to log in
How to pass callback to gulp task?
The point is. There is a gulp task jade, to which the path of the location of the view files is passed, and then the task will convert each file to html. The problem is that for each file it does a livereload reload and for each file it does a notification.
gulp.task 'jade', ->
gulp.src paths.views
.pipe plumber errorHandler: notify.onError "Error: <%= error.message %>"
.pipe jade
pretty: true
.pipe gulp.dest paths.app
.pipe connect.reload()
.pipe notify
message: "jade task complete"
open: "http://localhost:#{config.port}"
gulp.task 'jade', ['jade-compile'], ->
gulp
.src paths.app
.pipe connect.reload()
.pipe notify
message: "jade task complete"
open: "http://localhost:#{config.port}"
# Сам процесс сборки
gulp.task 'jade-compile', ->
gulp.src paths.jade.views
.pipe plumber errorHandler: notify.onError "Error: <%= error.message %>"
.pipe jade
pretty: true
.pipe gulp.dest paths.app
Answer the question
In order to leave comments, you need to log in
Your option is not the worst, you just need to use return
return gulp.src('path')
.pipe().....
jade
├ common/
├ header.jade
└ footer.jade
├ layouts/
└ layout.jade
├ index.jade
├ page2.jade
└ page3.jade
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question