diff options
author | Alex Dima <alexdima@microsoft.com> | 2016-06-24 16:10:35 +0300 |
---|---|---|
committer | Alex Dima <alexdima@microsoft.com> | 2016-06-24 19:47:26 +0300 |
commit | f5f5eb60b3ca1ab82b985d0a46ebb7990ea7197e (patch) | |
tree | e120fb0196aee15a6d5215bb5644752b615820a6 /gulpfile.js | |
parent | 02adcfd63cd2fd26790adb53ec40d34ef35bc209 (diff) |
Improve monaco.d.ts generation task
Diffstat (limited to 'gulpfile.js')
-rw-r--r-- | gulpfile.js | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/gulpfile.js b/gulpfile.js index 2c1cfd596f7..5f5835012aa 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -106,11 +106,6 @@ function watchTask(out, build) { function monacodtsTask(out, isWatch) { - var filesToWatchMap = {}; - monacodts.getFilesToWatch(out).forEach(function(filePath) { - filesToWatchMap[path.normalize(filePath)] = true; - }); - var timer = -1; var runSoon = function(howSoon) { @@ -144,23 +139,32 @@ function monacodtsTask(out, isWatch) { }; if (isWatch) { + + var filesToWatchMap = {}; + monacodts.getFilesToWatch(out).forEach(function(filePath) { + filesToWatchMap[path.normalize(filePath)] = true; + }); + watch('build/monaco/*').pipe(es.through(function() { - runSoon(500); + runSoon(5000); })); - } - var resultStream = es.through(function(data) { - var filePath = path.normalize(data.path); - if (isWatch && filesToWatchMap[filePath]) { - runSoon(5000); - } - this.emit('data', data); - }, function(end) { - runNow(); - this.emit('end'); - }); + return es.through(function(data) { + var filePath = path.normalize(data.path); + if (filesToWatchMap[filePath]) { + runSoon(5000); + } + this.emit('data', data); + }); + + } else { - return resultStream; + return es.through(null, function(end) { + runNow(); + this.emit('end'); + }); + + } } // Fast compile for development time |