From 1facce07e943e54fbecf35970dca43a86897f87a Mon Sep 17 00:00:00 2001 From: Nicolas Coden Date: Sun, 29 Apr 2018 15:26:38 +0200 Subject: [PATCH] fix: wait for gulp tasks ends with the `finish` event `pipe(done)` is a mistake and pipe does not work that way. `on('end')` may not be triggered because `end` is an interval stream event that does not reflect the whole gulp stream operation. Only `finish` should be used to wait for the operation end. See: https://stackoverflow.com/a/41003102/4317384 --- gulp/tasks/customizer.js | 2 +- gulp/tasks/deploy.js | 4 ++-- gulp/tasks/test.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gulp/tasks/customizer.js b/gulp/tasks/customizer.js index 041e63147..6740487b8 100644 --- a/gulp/tasks/customizer.js +++ b/gulp/tasks/customizer.js @@ -109,7 +109,7 @@ gulp.task('customizer:sass', function(done) { .pipe(cleancss({ compatibility: 'ie9' })) .pipe(rename('foundation.min.css')) .pipe(gulp.dest(path.join(OUTPUT_DIR, 'css'))) - .on('end', done); + .on('finish', done); }); }); diff --git a/gulp/tasks/deploy.js b/gulp/tasks/deploy.js index e7f6b7e06..6af30d780 100644 --- a/gulp/tasks/deploy.js +++ b/gulp/tasks/deploy.js @@ -89,7 +89,7 @@ gulp.task('deploy:dist', function(done) { .pipe(sourcemaps.write('.')) .pipe(gulp.dest('./dist/js')) - .pipe(done); + .on('finish', done); }); }); @@ -190,6 +190,6 @@ gulp.task('deploy:custom', function(done) { .pipe(uglify()) .pipe(rename('foundation.min.js')) .pipe(gulp.dest('./_build/assets/js')) - .on('end', done); + .on('finish', done); }); }); diff --git a/gulp/tasks/test.js b/gulp/tasks/test.js index d37d0469b..ecb14c910 100644 --- a/gulp/tasks/test.js +++ b/gulp/tasks/test.js @@ -41,6 +41,6 @@ gulp.task('test:transpile-js', function(done) { .on('error', onBabelError)) .pipe(concat('js-tests.js')) .pipe(gulp.dest('test/javascript')) - .on('end', done); + .on('finish', done); }); }); -- 2.47.2