-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
53 lines (46 loc) · 1.07 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
const gulp = require("gulp");
const browserSync = require("browser-sync");
const sass = require("gulp-sass");
const pug = require("gulp-pug");
const minify = require("gulp-minify");
gulp.task("pug", () => {
gulp
.src("./src/layaut/index.pug")
.pipe(
pug({
pretty: true,
})
)
.pipe(gulp.dest("./public"));
});
gulp.task("sass", () => {
return gulp
.src("src/scss/*.scss")
.pipe(sass({ outputStyle: "compressed" }))
.pipe(gulp.dest("./public/css"))
.pipe(browserSync.stream());
});
gulp.task("js", () => {
return gulp
.src(["./src/js/cont.js"])
.pipe(
minify({
ext: {
min: ".min.js",
},
})
)
.pipe(gulp.dest("./public/js"))
.pipe(browserSync.stream());
});
gulp.task("serve", ["sass", "js"], () => {
browserSync.init({
server: "./public",
});
gulp.watch(
["./src/js/*.js", "./src/scss/*.scss", "./src/layaut/*.pug"],
["sass", "pug"]
);
gulp.watch(["src/*"]).on("change", browserSync.reload);
});
gulp.task("default", ["js", "sass", "pug", "serve"]);