-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathgulpfile.js
More file actions
45 lines (36 loc) · 891 Bytes
/
gulpfile.js
File metadata and controls
45 lines (36 loc) · 891 Bytes
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
const gulp = require("gulp");
const rename = require("gulp-rename");
gulp.task('copy-pics',function(){
return gulp.src([
'./pics/*.png',
])
.pipe(gulp.dest('./dist/pics'));
});
gulp.task('copy-workers',function(){
return gulp.src([
'./workers/*.js',
])
.pipe(gulp.dest('./dist/'));
});
gulp.task("noNotFound", () => {
return gulp.src([
'./dist/index.html',
])
.pipe(rename("404.html"))
.pipe(gulp.dest('./dist/'));
})
gulp.task("noJekyll", async () => {
const path = require("path");
const fs = require("fs");
const route = path.join("./dist", ".nojekyll");
fs.writeFileSync(route, "");
new Promise(res => fs.writeFile(route, "", () => {
res();
}));
})
gulp.task("default",
gulp.parallel(
"copy-pics",
"noNotFound",
"noJekyll",
"copy-workers"));