-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
44 lines (40 loc) · 974 Bytes
/
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
const babel = require('gulp-babel');
const gulp = require('gulp');
const gulpRm = require('gulp-rimraf');
const rm = require('rimraf');
var exec = require('child_process').exec;
gulp.task('cleandocs', () => {
return gulp
.src(['docs/**/*', '!docs/textlogo.svg', '!docs/documentation.yml'])
.pipe(gulpRm());
});
gulp.task('predocs', () => {
return gulp
.src('src/**/*')
.pipe(
babel({
only: 'src/**/*.js',
presets: ['flow'],
plugins: [
'dynamic-import-webpack',
'syntax-object-rest-spread',
'syntax-class-properties',
'syntax-jsx'
]
})
)
.pipe(gulp.dest('temp'));
});
gulp.task('makedocs', ['predocs'], cb => {
exec(
'npx documentation build temp/** -o docs -c docs/documentation.yml -f html',
(err, stdout, stderr) => {
console.log(stdout);
console.log(stderr);
cb(err);
}
);
});
gulp.task('docs', ['predocs', 'makedocs'], cb => {
rm('temp/', cb);
});