-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
49 lines (41 loc) · 1.16 KB
/
gulpfile.js
File metadata and controls
49 lines (41 loc) · 1.16 KB
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
var gulp = require('gulp'),
plugins = require('gulp-load-plugins')();
var BUILD_PATH = './build/';
var JS_LOCATIONS = [
'./index.js',
'./models/*.js'
];
gulp.task('jshint', function () {
return gulp.src(JS_LOCATIONS)
.pipe(plugins.jshint('.jshintrc'))
.pipe(plugins.jshint.reporter('jshint-stylish'));
});
// format JavaScript based on pretty rules
gulp.task('pretty', function () {
return gulp.src(JS_LOCATIONS, {base: '.'})
.pipe(plugins.jsbeautifier({ config: '.jsbeautifyrc' }))
.pipe(gulp.dest('.'))
});
// bump version
gulp.task('bump', function () {
return gulp.src('./package.json')
.pipe(plugins.bump({type: 'patch'}))
.pipe(gulp.dest('./'));
});
// del build
gulp.task('clean', function () {
return require('del')(BUILD_PATH);
});
// build documentation
gulp.task('docs', function () {
return gulp.src(JS_LOCATIONS.concat(['README.md']), {base: '.'})
.pipe(plugins.doxx({
title: 'HashDo Database (MongoDB)',
urlPrefix: ''
}))
.pipe(gulp.dest(BUILD_PATH + 'docs'));
});
gulp.task('watch', function () {
gulp.watch(JS_LOCATIONS, gulp.series('jshint'));
});
gulp.task('default', gulp.series('watch'));