-
Notifications
You must be signed in to change notification settings - Fork 4
/
gulpfile.js
40 lines (32 loc) · 914 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
(function() {
'use strict';
var gulp = require('gulp'),
nodemon = require('gulp-nodemon'),
watch = require('gulp-watch'),
jshint = require('gulp-jshint'),
livereload = require('gulp-livereload'),
_paths = ['server.js', 'app/**/*.js', 'public/**/*.(html|css|js)'];
//register nodemon task - this runs the app
gulp.task('nodemon', function() {
nodemon({
script: 'server.js',
env: {
'NODE_ENV': 'development'
}
})
.on('restart');
});
// Rerun the task when a file changes
gulp.task('watch', function() {
livereload.listen();
watch(_paths, livereload.changed);
});
//lint js files
gulp.task('lint', function() {
gulp.src(_paths)
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
// The default task (called when you run `gulp` from cli)
gulp.task('default', ['lint', 'nodemon', 'watch']);
}());