-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgulpfile.js
More file actions
executable file
·35 lines (30 loc) · 812 Bytes
/
gulpfile.js
File metadata and controls
executable file
·35 lines (30 loc) · 812 Bytes
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
var requireDir = require('require-dir'),
gulp = require('gulp'),
livereload = require('gulp-livereload'),
config = require('./gulp/config'),
tasks = requireDir('./gulp/tasks', { recurse: true, duplicates: true });
gulp.on('stop', function () {
if(!livereload.server) {
process.nextTick(function () {
process.exit(0);
});
}
});
(function() {
var tree = gulp.tree().nodes,
regexMain = /^\w+$/g,
regexWatch = /.+:watch$/g,
tasksMain = [],
tasksWatch = [],
i = 0, task;
for(; (task = tree[i]) !== undefined; i++) {
if(regexMain.test(task)) {
tasksMain.push(task);
}
if(regexWatch.test(task)) {
tasksWatch.push(task);
}
}
gulp.task('default', gulp.parallel.apply(null, tasksMain));
gulp.task('watch', gulp.parallel.apply(null, tasksWatch));
}());