-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathgulpfile.js
43 lines (37 loc) · 1 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
var gulp = require('gulp');
var Dgeni = require('dgeni');
var del = require('del');
var bower = require('bower');
var runSequence = require('run-sequence');
gulp.task('dgeni', function() {
try {
var dgeni = new Dgeni([require('./docs/dgeni-conf')]);
return dgeni.generate();
} catch(x) {
console.log(x.stack);
throw x;
}
});
gulp.task('bower', function() {
var bowerTask = bower.commands.install();
bowerTask.on('log', function (result) {
console.log('bower:', result.id, result.data.endpoint.name);
});
bowerTask.on('error', function(error) {
console.log(error);
});
return bowerTask;
});
gulp.task('assets', ['bower'], function() {
return gulp.src('bower_components/**/*')
.pipe(gulp.dest('build/lib'));
});
gulp.task('clean', function(done) {
del(['./build'], done);
});
gulp.task('watch', ['default'], function() {
return gulp.watch(['docs/**/*', 'src/**/*'], ['default']);
});
gulp.task('default', function(cb) {
runSequence('clean', ['dgeni', 'assets'], cb);
});