Add auto: false to livereload calls so build works

Build worked when env was production but jammed if it was not because of
the livereload server being up and running. That can be prevented by
using option auto: false, but this introduces an issue where the
livereload server is not started at all if auto: false call gets executed
first (and it would if the assets were built first). Thus, start the
watch task first.
This commit is contained in:
Vesa Poikajärvi
2014-10-24 10:49:19 +07:00
parent 3199a0fa65
commit 4445fce04b

View File

@@ -61,7 +61,7 @@ gulp.task 'templates', ->
.on 'error', handleError
.pipe gulp.dest paths.templates.destination
pipeline = pipeline.pipe livereload() unless production
pipeline = pipeline.pipe livereload(auto: false) unless production
pipeline
@@ -76,7 +76,7 @@ gulp.task 'styles', ->
styles = styles.pipe(CSSmin()) if production
styles = styles.pipe gulp.dest paths.styles.destination
styles = styles.pipe livereload() unless production
styles = styles.pipe livereload(auto: false) unless production
styles
gulp.task 'assets', ->
@@ -120,4 +120,4 @@ gulp.task 'no-js', ['templates', 'styles', 'assets']
gulp.task 'build', ['scripts', 'no-js']
# scripts and watch conflict and will produce invalid js upon first run
# which is why the no-js task exists.
gulp.task 'default', ['no-js', 'watch', 'server']
gulp.task 'default', ['watch', 'no-js', 'server']