forked from ColemanGariety/gulp-nodemon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
46 lines (40 loc) · 1.03 KB
/
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
46
var gulp = require('gulp')
, jshint = require('gulp-jshint')
, nodemon = require('./index')
// , path = require('path')
// gulp.task('test', function () {
// gulp.src('./test/*-test.js')
// .pipe(jshint({ asi: true, laxcomma: true }))
// .pipe(mocha({ ui: 'bdd' }))
// })
function lint () {
gulp.src('./*/**.js')
.pipe(jshint())
}
gulp.task('lint', lint)
function cssmin (){ /* void */ }
gulp.task('cssmin', cssmin)
gulp.task('afterstart', function (){
console.log('proc has finished restarting!')
})
gulp.task('test', gulp.parallel([lint]), function () {
var stream = nodemon({
nodemon: require('nodemon')
, script: './test/server.js'
, verbose: true
, env: {
'NODE_ENV': 'development'
}
, watch: './'
, ext: 'js coffee'
})
stream
.on('restart', cssmin)
.on('crash', function (){
console.error('\nApplication has crashed!\n')
console.error('Restarting in 2 seconds...\n')
setTimeout(function () {
stream.emit('restart')
}, 2000)
})
})