Skip to content

Instantly share code, notes, and snippets.

@nelreina
Last active August 29, 2015 14:21
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 nelreina/7bdb62acd15d2ecd8a5c to your computer and use it in GitHub Desktop.
Save nelreina/7bdb62acd15d2ecd8a5c to your computer and use it in GitHub Desktop.
Simple server gulpfile with jshint and nodemon
/**
* Created by nelsonreina on 5/14/15.
*/
var gulp = require('gulp'),
nodemon = require('gulp-nodemon'),
jshint = require('gulp-jshint');
var jsFiles = './public/js/**/*.js';
gulp.task('default', ['jshint', 'nodemon', 'watch']);
gulp.task('jshint', function () {
return gulp.src(jsFiles)
.pipe(jshint())
.pipe(jshint.reporter('default'))
});
gulp.task('nodemon', function() {
nodemon({
script:'server.js',
ext:'js',
ignore:['node_modules/*', 'src/*', 'bower_components/*', 'dist/*'],
env:{
PORT:8009
}
});
});
gulp.task('watch', function () {
gulp.watch(jsFiles, ['jshint']);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment