-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
41 lines (34 loc) · 1.04 KB
/
gulpfile.js
File metadata and controls
41 lines (34 loc) · 1.04 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
const gulp = require("gulp")
const cleanCSS = require("gulp-clean-css")
const gulpSASS = require("gulp-sass")(require("node-sass"))
const Render = require("./app/helpers/render")
const input = {
dot: ["src/views/**/*.@(jst|def|dot)", "custom/src/views/**/*.@(jst|def|dot)"],
sass: ["src/stylesheets/*.?(s)css", "custom/src/stylesheets/*.?(s)css"],
static: ["src/static/**/*"],
}
const output = {
sass: "public/css",
static: "public/static",
}
function static() {
return gulp.src(input.static)
.pipe(gulp.dest(output.static))
}
function dot() {
return Render.compileTemplates()
}
function sass() {
return gulp.src(input.sass)
.pipe(gulpSASS().on("error", gulpSASS.logError))
.pipe(cleanCSS({debug: "development"}, details => {
console.log(`${details.name}: ${details.stats.originalSize} -> ${details.stats.minifiedSize}`)
}))
.pipe(gulp.dest(output.sass))
}
gulp.task("watch", () => {
gulp.watch(input.dot, dot)
gulp.watch(input.sass, sass)
gulp.watch(input.static, static)
})
gulp.task("build", gulp.parallel(dot, sass, static))