Gulp

Automate and enhance your workflow

Here's some of the sweet stuff you try out with this repo.

Installation

npm install -S gulp gulp-concat

Usage

Watch

var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var jsdoc = require("gulp-jsdoc");

var third_parties = [
  "bower_components/jquery/dist/jquery.js",
  "bower_components/bootstrap/dist/js/bootstrap.js",
  "bower_components/underscore/underscore.js",
  "bower_components/ring/ring.js",
  "bower_components/moment/moment.js",
  "bower_components/sprintf/src/sprintf.js",
  "bower_components/uri.js/src/URI.js",
  "bower_components/run/run.js"
];

var modules = [
  "modules/your_script.js"
];

gulp.watch(third_parties, ['js_thirdparty']);
gulp.watch(modules, ['js_modules']);

gulp.task('js_thirdparty', function () {
  return gulp
    .src(third_parties)
    .pipe(concat('third_party.uglify.js'))
    .pipe(uglify())
    .pipe(gulp.dest('./scripts'));
});

gulp.task('js_modules', function () {
  return gulp
    .src(modules)
    .pipe(concat('modules.uglify.js'))
    //.pipe(uglify())
    .pipe(gulp.dest('./scripts'));
});

gulp.task('documentation', function () {
  return gulp
    .src("./modules/*/*.js")
    .pipe(jsdoc('./documentation'));
});

gulp.task('default', ['js_thirdparty', 'js_modules']);

http://gulpjs.com/

Deprecated

grunt