From cd063b91889c7a0c6ec9b39930bb3c540ec7f3c3 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Fri, 13 Nov 2015 09:09:42 +0000 Subject: [PATCH] chore(gulpfile): add 500ms read delay on all watches --- gulpfile.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index da1075eb29..6cb921568f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -250,7 +250,7 @@ function filterOutExcludedPatterns(fileNames, excludeMatchers) { function apiSourceWatch(postBuildAction) { var srcPattern = [path.join(ANGULAR_PROJECT_PATH, 'modules/angular2/src/**/*.*')]; - watch(srcPattern, function (event, done) { + watch(srcPattern, {readDelay: 500}, function (event, done) { console.log('API source changed'); console.log('Event type: ' + event.event); // added, changed, or deleted console.log('Event path: ' + event.path); // The path of the modified file @@ -263,7 +263,7 @@ function apiExampleWatch(postShredAction) { var examplesPattern = [path.join(ANGULAR_PROJECT_PATH, 'modules/angular2/examples/**/*.*')]; var cleanPath = [path.join(_apiShredOptions.fragmentsDir, '**/*.*'), '!**/*.ovr.*']; - watch(examplesPattern, function (event, done) { + watch(examplesPattern, {readDelay: 500}, function (event, done) { console.log('API example changed'); console.log('Event type: ' + event.event); // added, changed, or deleted console.log('Event path: ' + event.path); // The path of the modified file @@ -306,7 +306,7 @@ function buildApiDocs(targetLanguage) { function devGuideExamplesWatch(shredOptions, postShredAction) { var pattern = path.join(shredOptions.examplesDir, "**/*.*"); - watch([pattern], function (event, done) { + watch([pattern], { readDelay: 500 }, function (event, done) { console.log('Event type: ' + event.event); // added, changed, or deleted console.log('Event path: ' + event.path); // The path of the modified file docShredder.shredSingleDir(shredOptions, event.path).then(function () {