-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
36 lines (30 loc) · 947 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
const {src, dest, watch, parallel} = require("gulp");
const scss = require('gulp-sass')(require('sass'));
const browserSync = require('browser-sync').create();
function SASSpreprocessing() {
return src("./src/scss/style.scss")
.pipe(scss({outputStyle: "compressed"}))
.pipe(dest('./public/css'))
.pipe(browserSync.stream());
}
function HTMLpreprocessing() {
return src("src/*.html")
.pipe(dest('public'));
}
function browser() {
browserSync.init({
server: {
baseDir: "public"
}
});
}
function watching() {
watch(["src/scss/**/*.scss"], SASSpreprocessing);
watch(["src/*.html"], HTMLpreprocessing);
watch("public/*.html").on('change', browserSync.reload);
}
exports.SASSpreprocessing = SASSpreprocessing;
exports.HTMLpreprocessing = HTMLpreprocessing;
exports.watching = watching;
exports.browser = browser;
exports.default = parallel(browser, watching);