Created
February 25, 2014 23:13
-
-
Save svileng/9220031 to your computer and use it in GitHub Desktop.
Combining two sources in a single Gulp task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var es = require('event-stream'); | |
var coffee = require('gulp-coffee'); | |
var concat = require('gulp-concat'); | |
var uglify = require('gulp-uglify'); | |
var gutil = require('gulp-util'); | |
var paths = { | |
coffeeSrc: 'assets/coffee/**/*.coffee', | |
coffeeDest: 'assets/js', | |
buildScriptsSrc: [ | |
'bower_components/jquery/jquery.min.js', | |
'bower_components/angular/angular.min.js', | |
'assets/js/app.js', | |
'assets/js/*.js' | |
], | |
buildDest: 'public' | |
}; | |
gulp.task('build-scripts', function() { | |
return es.concat( | |
gulp.src(paths.coffeeSrc) | |
.pipe(coffee({bare: true}).on('error', gutil.log)) | |
.pipe(gulp.dest(paths.coffeeDest)), | |
gulp.src(paths.buildScriptsSrc) | |
.pipe(uglify()) | |
.pipe(concat('app.min.js')) | |
.pipe(gulp.dest(paths.buildDest)) | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment