-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathgulpfile.js
48 lines (39 loc) · 1001 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
39
40
41
42
43
44
45
46
47
48
/** Declare module */
const { src, dest, parallel, watch, series } = require("gulp"),
concat = require("gulp-concat"),
sass = require("gulp-sass"),
browserSync = require("browser-sync").create();
/** Files Path */
const FilesPath = {
sassFiles: "assets/scss/**",
htmlFiles: "*.html"
};
const { sassFiles, htmlFiles} = FilesPath;
/** Sass Task */
function sassTask() {
return src(sassFiles)
.pipe(sass({ outputStyle: "compressed" }))
.pipe(concat("style.css"))
.pipe(dest("assets/css"))
.pipe(browserSync.stream());
}
/** HTML Task */
function htmlTask() {
return src(htmlFiles)
.pipe(browserSync.stream());
}
/** Watch Task */
function serve() {
browserSync.init({
server: {
baseDir: "./",
},
port: 3000
});
watch(sassFiles, sassTask);
watch(htmlFiles, htmlTask)
}
exports.sass = sassTask;
exports.html = htmlTask;
exports.default = series(parallel(htmlTask, sassTask));
exports.serve = series(serve, parallel(htmlTask, sassTask));