-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
63 lines (56 loc) · 1.36 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/** @format */
import gulp from "gulp";
import uglify from "gulp-terser";
import htmlmin from "gulp-htmlmin";
import postcss from "gulp-postcss";
import cssnano from "cssnano";
import autoprefixer from "autoprefixer";
import cachebust from "gulp-cache-bust";
import imagemin from "gulp-imagemin";
import ttf2woff from "gulp-ttf2woff";
import browserSync from "browser-sync";
const puglinsCss = [cssnano(), autoprefixer()];
const html = () => {
return gulp
.src("src/**/*.html")
.pipe(
cachebust({
type: "timestamp",
})
)
.pipe(htmlmin({ collapseWhitespace: true, removeComments: true }))
.pipe(gulp.dest("public"));
};
const css = () => {
return gulp
.src("src/css/**/*.css")
.pipe(postcss(puglinsCss))
.pipe(gulp.dest("public/css"));
};
const assets = () => {
return gulp
.src("src/assets/**/*")
.pipe(imagemin())
.pipe(gulp.dest("public/assets"));
};
const font = () => {
return gulp
.src("src/font/**/*.ttf")
//.pipe(ttf2woff())
.pipe(gulp.dest("public/font"));
};
const javascript = () => {
return gulp
.src("src/js/**/**/*.js")
.pipe(uglify())
.pipe(gulp.dest("public/js"));
};
const data = () => {
return gulp
.src("src/data/**/*.js")
.pipe(uglify())
.pipe(gulp.dest("public/data"));
};
/*
gulp.task("built", gulp.parallel(html, css, assets, font, javascript, data));
*/