-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathgulpfile.js
54 lines (45 loc) · 1.05 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
const yaml = require('gulp-yaml')
const gulp = require('gulp')
const { parallel, series } = gulp
const del = require('del')
const minify = require('gulp-jsonminify')
function genSounds(cb) {
gulp
.src('./sounds.yml')
.pipe(yaml({ space: 2 }))
.pipe(minify())
.pipe(gulp.dest('./dist/'))
cb()
}
function genCategories(cb) {
gulp
.src('./categories.yml')
.pipe(yaml({ space: 2 }))
.pipe(minify())
.pipe(gulp.dest('./dist/'))
cb()
}
function genNotice(cb){
gulp
.src('./notice.yml')
.pipe(yaml({ space: 2 }))
.pipe(minify())
.pipe(gulp.dest('./dist/'))
cb()
}
function copyAssets(cb) {
gulp.src('*.*', { read: false }).pipe(gulp.dest('./dist/assets'))
gulp.src('./assets/**/*').pipe(gulp.dest('./dist/assets'))
cb()
}
function noJekyll(cb) {
gulp.src('.nojekyll').pipe(gulp.dest('./dist'))
cb()
}
function clean(cb) {
del(['dist/*'])
cb()
}
const genTask = parallel(genSounds, genCategories, genNotice, noJekyll, copyAssets)
const defaultTask = series(clean, genTask)
exports.default = defaultTask