forked from hdngr/sriracha
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
61 lines (57 loc) · 1.48 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
'use strict';
var gulp = require('gulp'),
nodemon = require('gulp-nodemon'),
mocha = require('gulp-mocha'),
livereload = require('gulp-livereload'),
args = require('minimist')(process.argv);
gulp.task('simple', function() {
livereload.listen();
var nodeArgs = [];
// used to run nodemon in --debug-brk mode
if (args.dev || args.d) {
nodeArgs.push('--debug');
}
if (args['debug-brk']) {
nodeArgs.push('--debug-brk');
}
return nodemon({
script: 'examples/simple/server.js',
ext: 'js',
nodeArgs: nodeArgs,
verbose: true
}).on('restart', function() {
livereload.reload();
});
});
gulp.task('advanced', function() {
livereload.listen();
var nodeArgs = [];
// used to run nodemon in --debug-brk mode
if (args.dev || args.d) {
nodeArgs.push('--debug');
}
if (args['debug-brk']) {
nodeArgs.push('--debug-brk');
}
return nodemon({
script: 'examples/advanced/server.js',
ext: 'js',
nodeArgs: nodeArgs,
verbose: true
}).on('restart', function() {
livereload.reload();
})
});
gulp.task('test', function() {
return gulp.src('tests', {
read: false
})
// gulp-mocha needs filepaths so you can't have any plugins before it
.pipe(mocha({
reporter: 'spec',
bail: false
}))
.once('end', function() {
process.exit();
});
});