diff --git a/templates/gulpfile.js.twig b/templates/gulpfile.js.twig index 3be85efddf5a6e863266decd8be87cf3a9c95f8d..60b49edd8dc665a1df328e1e02f4635de67cbb4f 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'));