Maybe someone with a bit more java script experience than myself can answer this. So far I've made a copy & paste from the 'usemin' block as shown in a course. Here's the code:
gulp.task('useminTrigger', ['deleteDistFolder'], function() {
gulp.start("usemin", "usemin-de");
});
gulp.task('usemin', ['styles', 'scripts'], function () {
return gulp.src("./app/index.html")
.pipe(usemin({
css: [function () {return rev()}, function () {return cssnano()}],
js: [function () {return rev()}, function () {return uglify()}]
}))
.pipe(gulp.dest("./dist"));
});
gulp.task('usemin-de', ['styles', 'scripts'], function () {
return gulp.src("./app/de/index.html")
.pipe(usemin({
css: [function () {return rev()}, function () {return cssnano()}],
js: [function () {return rev()}, function () {return uglify()}]
}))
.pipe(gulp.dest("./dist/de"));
});
The script works as it should but maybe there is a easier or more elegant way to code that.
And with elegant i mean: Is there a way to merge the usemin-block together with usemin-de?
Help would be very much appreciated. Thanks in advance!