-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
44 lines (37 loc) · 1.06 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
(function (global) {
'use strict';
var gulp = require('gulp'),
gulpWatch = require('gulp-watch'),
jsdoc = require('gulp-jsdoc'),
jshint = require('gulp-jshint'),
jshintStylish = require('jshint-stylish'),
colors = require('colors');
function jsdocTask() {
return gulp.src('./cubletApi/**/*.js')
.pipe(jsdoc('./docs'));
}
function jsdocWatchTask() {
jsdocTask();
gulpWatch('./cubletApi/**/*.js', function () {
global.console.log(colors.yellow.underline('JSDoc Run'));
jsdocTask();
});
}
function jshintTask() {
return gulp.src(['./cubletApi/**/*.js', './server.js'])
.pipe(jshint())
.pipe(jshint.reporter(jshintStylish));
}
function jshintWatchTask() {
jshintTask();
gulpWatch(['./cubletApi/**/*.js', './server.js'], function () {
global.console.log(colors.yellow.underline('JSHint Run'));
jshintTask();
});
}
gulp.task('jsdoc', jsdocTask);
gulp.task('jsdocWatch', jsdocWatchTask);
gulp.task('jshint', jshintTask);
gulp.task('jshintWatch', jshintWatchTask);
gulp.task('default', ['jshintWatch', 'jsdocWatch']);
}(global));