I\'m new to gulp and have been looking through example set-ups. Some people have the following structure:
gulp.task(\"XXXX\", function() {
gulp.src(\"...
I found this helpful, if you have multiple streams per task. You need to combine/merge the multiple streams and return them.
var gulp = require('gulp');
var merge = require('gulp-merge');
gulp.task('test', function() {
var bootstrap = gulp.src('bootstrap/js/*.js')
.pipe(gulp.dest('public/bootstrap'));
var jquery = gulp.src('jquery.cookie/jquery.cookie.js')
.pipe(gulp.dest('public/jquery'));
return merge(bootstrap, jquery);
});
The alternative, using Gulps task definition structure, would be:
var gulp = require('gulp');
gulp.task('bootstrap', function() {
return gulp.src('bootstrap/js/*.js')
.pipe(gulp.dest('public/bootstrap'));
});
gulp.task('jquery', function() {
return gulp.src('jquery.cookie/jquery.cookie.js')
.pipe(gulp.dest('public/jquery'));
});
gulp.task('test', ['bootstrap', 'jquery']);