I have this tasks:
html:
build
if I run gulp build
and then gulp html
, everything works fine. But, if a add html
as build last part, don't work more.
Jade is transformed in a .html file, a all resources (my and bower) are copied to /dest folder, but wiredep
and inject
(that add script and link tags) appears do nothing.
This is (a part of) my tasks: https://gist.github.com/Falci/f52d4144318c9d5e4c2f
I see a couple potential issues with your build.
You must return the stream from each task. Gulp relies on the return value of each task to determine when that task is finished. If you use a task without a return value as a dependency of another task, the dependency will be resolved immediately instead of waiting for the task to finish. You should use return values instead of using the next()
callback.
function htmlAssetsTask () {
var sources = gulp.src(config.filesets.assetsDest, {read: false});
return gulp.src(config.filesets.html)
...
}
Gulp task dependencies are not run in order. This means that in the task:
gulp.task('build', ['clean:dest', 'build:js', 'build:less', 'html']);
the dependencies can run in any order. I suggest using the run-sequence package to ensure the order of task dependencies when it is important.