forked from planetoftheweb/githubactions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
executable file
·56 lines (48 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
44
45
46
47
48
49
50
51
52
53
54
55
56
var gulp = require('gulp'),
webserver = require('gulp-server-io'),
folderIndex = require('gulp-folder-index'),
source = './dist/',
dest = './dist/';
function html() {
return gulp.src(dest + '**/*.html');
}
function js() {
return gulp.src(dest + '**/*.js');
}
function styles() {
return gulp.src(dest + '**/*.css');
}
function slides() {
return gulp
.src(source + 'slides/**/*.md')
.pipe(
folderIndex({
extension: '.md',
filename: 'index.json'
})
)
.pipe(gulp.dest(dest + 'slides'));
}
function watch() {
gulp.watch(source + '**/*.js', js);
gulp.watch(source + '**/*.css', styles);
gulp.watch(source + '**/*.html', html);
gulp.watch(source + 'slides/**/*.md', slides);
}
function server() {
return gulp.src(dest).pipe(
webserver({
serverReload: {
dir: dest
},
port: 3232,
open: true
})
);
}
var build = gulp.series(
gulp.parallel(slides, js, styles, html),
server,
watch
);
gulp.task('default', build);