-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
61 lines (51 loc) · 1.57 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
57
58
59
60
61
var gulp = require('gulp'),
sass = require('gulp-sass'),
ejs = require('gulp-ejs'),
runSequence = require('run-sequence'),
sitemap = require('gulp-sitemap')
gulp.task('sass', function () {
return gulp.src('src/styles/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('docs/styles'))
})
gulp.task('scripts', function() {
return gulp.src('src/js/**/*.js')
.pipe(gulp.dest('docs/scripts'))
})
gulp.task('ejs',function(){
return gulp.src('src/views/*.ejs')
.pipe(ejs({},{}, {ext:'.html'}))
.pipe(gulp.dest('docs/'))
})
gulp.task('images',function(){
return gulp.src('src/images/**/*.*')
.pipe(gulp.dest('docs/images/'))
})
gulp.task('videos',function(){
return gulp.src('src/videos/**/*.*')
.pipe(gulp.dest('docs/videos/'))
})
gulp.task('move-google-verification', function(){
return gulp.src('google8e356c7d3c1d1496.html')
.pipe(gulp.dest('docs/'))
})
gulp.task('sitemap', function () {
gulp.src('docs/**/*.html', {
read: false
})
.pipe(sitemap({
siteUrl: 'https://hap.video'
}))
.pipe(gulp.dest('./docs'))
})
gulp.task('watch', function() {
gulp.watch('src/styles/**/*.scss', ['sass'])
gulp.watch('src/js/**/*.js', ['scripts'])
gulp.watch('src/views/**/*.ejs', ['ejs'])
gulp.watch('src/images/**/*.*', ['images'])
gulp.watch('src/videos/**/*.*', ['videos'])
})
gulp.task('build', ['sass', 'scripts', 'ejs', 'images', 'videos', 'move-google-verification'], function (cb) {
runSequence(['sitemap'], cb);
})
gulp.task('default', ['build', 'watch'])