Skip to content
Snippets Groups Projects
Commit 3b05eb8b authored by Felix Häberle's avatar Felix Häberle :speech_balloon:
Browse files

fix js logic and decouple it from the font logic

parent f43c24ea
No related branches found
No related tags found
1 merge request!1add support for gulp v4
...@@ -38,8 +38,12 @@ gulp.task('fonts-{{ package.name }}', function() { ...@@ -38,8 +38,12 @@ gulp.task('fonts-{{ package.name }}', function() {
// Provide fonts from all libraries // 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', {% if fontDefined %}gulp.series(gulp.parallel({% for name, package in bower_assets %}{% if package.fonts is defined %}'fonts-{{ package.name }}', {% endif %}{% endfor %})){% endif %});
{# This variable is needed to search for defined js in packages #}
{% set jsDefined = false %}
{% for name, package in bower_assets %} {% for name, package in bower_assets %}
{% if package.js is defined %} {% if package.js is defined %}
{% set jsDefined = true %}
// Provide JS from {{ name }} // Provide JS from {{ name }}
gulp.task('js-{{ package.name }}', function() { gulp.task('js-{{ package.name }}', function() {
return gulp.src('{{ package.js.relative }}/**') return gulp.src('{{ package.js.relative }}/**')
...@@ -49,7 +53,7 @@ gulp.task('js-{{ package.name }}', function() { ...@@ -49,7 +53,7 @@ gulp.task('js-{{ package.name }}', function() {
{% endif %} {% endif %}
{% endfor %} {% endfor %}
// Provide JS from all libraries // Provide JS from all libraries
gulp.task('js', {% if fontDefined %}gulp.series(gulp.parallel({% for name, package in bower_assets %}{% if package.js is defined %}'js-{{ package.name }}', {% endif %}{% endfor %})){% endif %}); 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 %});
// Pre-process CSS // Pre-process CSS
gulp.task('css', function() { gulp.task('css', function() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment