-
Notifications
You must be signed in to change notification settings - Fork 76
/
Gulpfile.js
42 lines (37 loc) · 911 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
var gulp = require('gulp')
, jshint = require('gulp-jshint')
, nodemon = require('./index')
// , path = require('path')
gulp.task('lint', function (){
return gulp.src('./*/**.js')
.pipe(jshint())
})
gulp.task('cssmin', function (done){
done();
})
gulp.task('afterstart', function (done){
console.log('proc has finished restarting!');
done();
})
gulp.task('test', gulp.series('lint', function (done){
var stream = nodemon({
nodemon: require('nodemon')
, script: './server.js'
, verbose: true
, env: {
'NODE_ENV': 'development'
}
, watch: './'
, ext: 'js coffee'
, done: done
})
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)
})
}))