Skip to content

Instantly share code, notes, and snippets.

@jewer
Created January 15, 2016 20:41
Show Gist options
  • Select an option

  • Save jewer/5a4a964ddbbff76faea9 to your computer and use it in GitHub Desktop.

Select an option

Save jewer/5a4a964ddbbff76faea9 to your computer and use it in GitHub Desktop.
simplest possible useful gulp file
var gulp = require('gulp'),
util = require('gulp-util'),
jshint = require('gulp-jshint'),
mocha = require('gulp-mocha');
var srcFiles = './src/**/*.js';
var testFiles = './test/**/*.js';
gulp.task('test', function() {
return gulp.src(testFiles, {read: false})
.pipe(mocha({reporter: 'nyan'}));
});
gulp.task('jshint', function() {
return gulp.src(srcFiles)
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('develop', ['test', 'jshint'], function () {
require('gulp-nodemon')({
script: 'start.js',
ignore: [ // only watch server files
'node_modules/*'
]
})
.on('restart', ['test', 'jshint']);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment