-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
40 lines (35 loc) · 1.12 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
const gulp = require("gulp");
const jsBeautify = require("gulp-jsbeautifier");
const htmlBeautify = require("gulp-html-beautify");
const nunjucksRender = require("gulp-nunjucks-render");
const compileHtml = () => {
return gulp
.src("src/views/!(layout.html)*", { nodir: true })
.pipe(
nunjucksRender({
path: ["src/views"],
})
)
.pipe(htmlBeautify({ max_preserve_newlines: 1 }))
.pipe(gulp.dest("dist", { overwrite: true }));
};
const compileJs = () => {
return gulp
.src("public/scripts/**")
.pipe(jsBeautify())
.pipe(gulp.dest("dist/scripts", { overwrite: true }));
};
const compileCss = () => {
return gulp
.src("public/styles/style.css", { nodir: true })
.pipe(gulp.dest("dist/styles", { overwrite: true }));
};
const compileAssets = () => {
return gulp
.src("public/assets/**")
.pipe(gulp.dest("dist/assets", { overwrite: true }));
};
gulp.task("compileJs", compileJs);
gulp.task("compileCss", compileCss);
gulp.task("compileHtml", compileHtml);
gulp.task("compileAssets", compileAssets);