Skip to content

Instantly share code, notes, and snippets.

@backflip
Created February 3, 2014 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save backflip/8787538 to your computer and use it in GitHub Desktop.
Save backflip/8787538 to your computer and use it in GitHub Desktop.
Lint, concatenate and compress JavaScript:
var gulp = require('gulp'),
gutil = require('gulp-util'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat');
gulp.task('js', function() {
return gulp.src('./source/assets/js/*.js')
.pipe(jshint())
.pipe(concat('main.js'))
.pipe(gutil.env.production ? uglify() : gutil.noop())
.pipe(gulp.dest('./build/assets/js'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment