Skip to content

Instantly share code, notes, and snippets.

@uesteibar
Created April 17, 2015 10:11
Show Gist options
  • Save uesteibar/68aad9527272cd81a2df to your computer and use it in GitHub Desktop.
Save uesteibar/68aad9527272cd81a2df to your computer and use it in GitHub Desktop.
Basic gulpfile for node.js
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var nodemon = require('gulp-nodemon');
var mocha = require('gulp-mocha');
var files = require('./gulp.config')();
gulp.task('jshint', function() {
gulp.src(files.dev.js)
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('test', function () {
return gulp.src(files.dev.testjs, {read: false})
.pipe(mocha({reporter: 'nyan'}));
});
gulp.task('develop', function () {
nodemon({ script: 'server.js'
, ext: 'js'
, tasks: ['jshint', 'test'] })
.on('restart', function () {
console.log('restarted!')
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment