From 3029d61c1957d54098121f1e2e291c94f33a813d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20H=C3=A4berle?= <kontakt@felixhaeberle.de>
Date: Mon, 28 Jan 2019 17:23:07 +0100
Subject: [PATCH] Update gulpfile with bugfixes

---
 templates/gulpfile.js.twig | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/templates/gulpfile.js.twig b/templates/gulpfile.js.twig
index 3be85ef..60b49ed 100644
--- a/templates/gulpfile.js.twig
+++ b/templates/gulpfile.js.twig
@@ -35,8 +35,15 @@ gulp.task('fonts-{{ package.name }}', function() {
 
 {% endif %}
 {% endfor %}
+
+{% if fontDefined %}
 // Provide fonts from all libraries
-gulp.task('fonts', {% if fontDefined %}gulp.series(gulp.parallel({% for name, package in bower_assets %}{% if package.fonts is defined %}'fonts-{{ package.name }}', {% endif %}{% endfor %})){% endif %});
+gulp.task('fonts', gulp.parallel(
+  {% for name, package in bower_assets %}
+  {% if package.fonts is defined %}'fonts-{{ package.name }}'{% if not loop.last %}, {% endif %}
+  {% endif %}
+  {% endfor %}));
+{% endif %}
 
 {# This variable is needed to search for defined js in packages #}
 {% set jsDefined = false %}
@@ -52,8 +59,15 @@ gulp.task('js-{{ package.name }}', function() {
 
 {% endif %}
 {% endfor %}
+
+{% if jsDefined %}
 // Provide JS from all libraries
-gulp.task('js', {% if jsDefined %}gulp.series(gulp.parallel({% for name, package in bower_assets %}{% if package.js is defined %}'js-{{ package.name }}', {% endif %}{% endfor %})){% endif %});
+gulp.task('js', gulp.parallel(
+  {% for name, package in bower_assets %}
+  {% if package.js is defined %}'js-{{ package.name }}'{% if not loop.last %}, {% endif %}
+  {% endif %}
+  {% endfor %}));
+{% endif %}
 
 // Pre-process CSS
 gulp.task('css', function() {
@@ -84,4 +98,4 @@ gulp.task('watch', function() {
 });
 
 // Default task: run all other tasks in the correct order
-gulp.task('default', gulp.series(gulp.parallel('fonts', 'js', 'css')));
+gulp.task('default', gulp.parallel({% if fontDefined %}'fonts', {% endif %}{% if jsDefined %}'js', {% endif %}'css'));
-- 
GitLab