I am currently working on managing multiple themes using a single gulp.js file.
// Optimize images
gulp.task('images', function () {
// Loop through different themes to optimize images
var themes = ['palo','alto'];
for (var i = 0; i < themes.length; i++) {
return gulp.src(themes[i]+'/images/**/*')
.pipe($.cache($.imagemin({
progressive: true,
interlaced: true
})))
.pipe(gulp.dest('dist/'+themes[i]+'/images'))
.pipe($.size({title: 'images'}));
}
});
Instead of creating separate blocks for each theme, I prefer to iterate through an array of themes in the gulp task.