-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathgulpfile.js
More file actions
46 lines (38 loc) · 1.16 KB
/
Copy pathgulpfile.js
File metadata and controls
46 lines (38 loc) · 1.16 KB
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
import gulp from "gulp";
import gulpSass from "gulp-sass";
import * as sassPkg from "sass";
import browserSync from "browser-sync";
import { nunjucksCompile as nunjucks } from "gulp-nunjucks";
const sass = gulpSass(sassPkg);
const srcStyles = "src/styles";
const destStyles = "public/fonts/routed-gothic/css";
const srcPages = "src/pages";
const destPages = "public/fonts/routed-gothic";
const excludePartials = [`!**/_*`, `!**/_*/**/*`];
function sassTask() {
return gulp.src(`${srcStyles}/app.scss`)
.pipe(sass({
quietDeps: true,
}))
.pipe(gulp.dest(destStyles));
}
function pagesTask() {
return gulp.src([`${srcPages}/**/*.njk`, ...excludePartials])
.pipe(nunjucks())
.pipe(gulp.dest(destPages));
}
function serveTask() {
const server = browserSync.create();
server.init({
startPath: "/fonts/routed-gothic/",
server: {
baseDir: "./public",
},
watch: true,
});
}
const build = gulp.parallel(pagesTask, sassTask);
export { sassTask as sass };
export { serveTask as serve };
export { pagesTask as pages };
export { build };