From: Nicolas Coden Date: Sun, 29 Apr 2018 13:26:38 +0000 (+0200) Subject: fix: wait for gulp tasks ends with the `finish` event X-Git-Tag: v6.6.0~3^2~218^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1facce07e;p=thirdparty%2Ffoundation%2Ffoundation-sites.git 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 --- 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); }); });