-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
38 lines (29 loc) · 915 Bytes
/
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
const { src, dest, series } = require("gulp");
const htmlMin = require("gulp-htmlmin");
const cssNano = require("gulp-cssnano");
const uglify = require("gulp-uglify");
function minifyParts() {
const partsFolder = "./src/views/parts";
return src(`${partsFolder}/*.ejs`)
.pipe(htmlMin())
.pipe(dest(`${partsFolder}/`));
}
function minifyPages() {
const viewsFolder = "./src/views";
return src(`${viewsFolder}/*.ejs`)
.pipe(htmlMin())
.pipe(dest(`${viewsFolder}/`));
}
function minifyStyles() {
const stylesFolder = "./public/styles";
return src(`${stylesFolder}/*.css`)
.pipe(cssNano())
.pipe(dest(`${stylesFolder}/`));
}
function minifyScripts() {
const scriptsFolder = "./public/scripts";
return src(`${scriptsFolder}/*.js`)
.pipe(uglify())
.pipe(dest(`${scriptsFolder}/`));
}
exports.default = series(minifyParts, minifyPages, minifyStyles, minifyScripts);