-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
executable file
·85 lines (74 loc) · 2.08 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// Include gulp
var gulp = require('gulp');
// Include Our Plugins
var sass = require('gulp-sass');
var browserSync = require('browser-sync').create();
gulp.task('sass', function() {
return gulp.src('app/scss/*.scss')
.pipe(sass())
.pipe(gulp.dest('html/css'))
.pipe(browserSync.reload({
stream: true
}))
});
gulp.task('watch', ['browserSync', 'sass', 'move-html', 'move-images', 'move-videos', 'move-js','move-audio'], function (){
gulp.watch('app/scss/*.scss', ['sass']);
gulp.watch('app/index.html', ['move-html']);
gulp.watch('app/images/*.png', ['move-images']);
gulp.watch(['app/videos/*.mp4', 'app/videos/*.vtt'], ['move-videos']);
gulp.watch('app/js/*.js', ['move-js']);
gulp.watch(['app/audio/*.mp3', 'app/audio/*.wav'], ['move-audio']);
// Other watchers
})
gulp.task('move-html', function(){
return gulp.src('app/index.html')
.pipe(gulp.dest('html'))
.pipe(browserSync.reload({
stream: true
}))
});
gulp.task('move-images', function(){
return gulp.src('app/images/*.png')
.pipe(gulp.dest('html/images'))
.pipe(browserSync.reload({
stream: true
}))
});
gulp.task('move-videos', function(){
return gulp.src(['app/videos/*.mp4', 'app/videos/*.vtt'])
.pipe(gulp.dest('html/videos'))
.pipe(browserSync.reload({
stream: true
}))
});
gulp.task('move-vtt', function(){
return gulp.src('app/videos/*.vtt')
.pipe(gulp.dest('html/videos'))
.pipe(browserSync.reload({
stream: true
}))
});
gulp.task('move-js', function(){
return gulp.src('app/js/*.js')
.pipe(gulp.dest('html/js'))
.pipe(browserSync.reload({
stream: true
}))
});
gulp.task('move-audio', function(){
return gulp.src(['app/audio/*.mp3', 'app/audio/*.wav'])
.pipe(gulp.dest('html/audio'))
.pipe(browserSync.reload({
stream: true
}))
});
gulp.task('browserSync', function() {
browserSync.init({
server: {
baseDir: 'html'
},
port: 8000
})
})
// Default Task
gulp.task('default', ['watch']);