-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
45 lines (36 loc) · 986 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
41
42
43
44
45
var gulp = require('gulp'),
nodemon = require('gulp-nodemon'),
plumber = require('gulp-plumber'),
eslint = require('gulp-eslint'),
livereload = require('gulp-livereload');
gulp.task('develop', function () {
livereload.listen();
nodemon({
script: 'app.js',
ext: 'js coffee ejs',
stdout: false
}).on('readable', function () {
this.stdout.on('data', function (chunk) {
if(/^Express server listening on port/.test(chunk)){
livereload.changed(__dirname);
}
});
this.stdout.pipe(process.stdout);
this.stderr.pipe(process.stderr);
});
});
gulp.task('default', [
'develop',
'watch'
]);
gulp.task('lint', function(){
return gulp.src(['app/**/*.js','config/**/*.js','public/js/*.js'])
.pipe(eslint({
configFile:".eslintrc"
}))
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task("watch",function(){
gulp.watch(['app/**/*.js','config/**/*.js','public/js/*.js'], ['lint']);
});