nelreina
5/15/2015 - 3:39 AM

Simple server gulpfile with jshint and nodemon

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']);
})