Skip to content

Instantly share code, notes, and snippets.

@digilord
Created March 1, 2014 10:56
Show Gist options
  • Save digilord/9288317 to your computer and use it in GitHub Desktop.
Save digilord/9288317 to your computer and use it in GitHub Desktop.
gulp.task('js:dev', ['clean:dev'], function() {
return es.concat(
gulp.src('app/js/**/*.coffee')
.pipe(coffee({base: true})),
gulp.src('app/js/**/*.js')
)
.pipe(concat('app.js'))
.pipe(gulp.dest('build/js'))
.pipe(watch())
.pipe(reload());
});
@nfroidure
Copy link

You could differ javascript read like this in order to get your hd less busy at the task launch.

var StreamQueue = require('streamqueue');

gulp.task('js:dev', ['clean:dev'], function() {

  var queue = new StreamQueue({objectMode: true});

  queue.queue(
     gulp.src('app/js/**/*.coffee')
    .once('end', function() {
        queue.done(gulp.src('app/js/**/*.js'));
     }).pipe(coffee({base: true}))
  ).pipe(concat('app.js'))
    .pipe(gulp.dest('build/js'));
});

Also, i removed the watch from the pipeline suince it doesnt make sense when merging files. There are special things to do to use gulp watch in this case, see the gulp-watch readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment