From 8c056702e316e0a975cdf35fbe09ee6c9586df2a Mon Sep 17 00:00:00 2001 From: Tim Buckley Date: Thu, 21 Apr 2016 10:47:35 -0600 Subject: [PATCH] Fix race condition in gulp prod and dev tasks This fixes a race condition in gulp tasks where the 'browserify' task would occasionally run before the 'views' task had finished, causing an exception to be thrown when it failed to find the generated templates. This makes the 'browserify' task wait for all other tasks to complete before running, so the templates will always be generated first. Change-Id: I17dd4cd234dc61b98ba9f0e5ab527d8798e28434 --- gulp/tasks/development.js | 4 ++-- gulp/tasks/production.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gulp/tasks/development.js b/gulp/tasks/development.js index 4923c2d5..55493eef 100644 --- a/gulp/tasks/development.js +++ b/gulp/tasks/development.js @@ -10,7 +10,7 @@ gulp.task('dev', ['clean'], function(cb) { global.isProd = false; runSequence( - ['styles', 'fonts', 'images', 'data', 'vendor-js', 'views', 'browserify', 'dev-resources'], - 'watch', cb); + ['styles', 'fonts', 'images', 'data', 'vendor-js', 'views', 'dev-resources'], + 'browserify', 'watch', cb); }); diff --git a/gulp/tasks/production.js b/gulp/tasks/production.js index 5e7e9a77..4b442661 100644 --- a/gulp/tasks/production.js +++ b/gulp/tasks/production.js @@ -10,7 +10,7 @@ gulp.task('prod', ['clean'], function(cb) { global.isProd = true; runSequence( - ['styles', 'fonts', 'images', 'vendor-js', 'views', 'browserify'], - 'gzip', cb); + ['styles', 'fonts', 'images', 'vendor-js', 'views'], + 'browserify', 'gzip', cb); });