forked from denali-design/denali-css
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
47 lines (41 loc) · 1023 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
"use strict";
const gulp = require("gulp");
const connect = require("gulp-connect-php");
const browserSync = require("browser-sync").create();
const sass = require("gulp-sass");
// const rename = require("gulp-rename");
const siteSass = () => {
return gulp
.src("scss/*.scss")
.pipe(sass.sync({
outputStyle: 'compressed'
}).on('error', sass.logError))
// .pipe(rename({
// suffix: '.min'
// }))
.pipe(gulp.dest("css"))
.pipe(browserSync.stream())
};
const disconnect = () => {
connect.closeServer();
};
gulp.task(
"serve",
gulp.series(siteSass, () => {
connect.server(
{
base: ".",
port: 4000
},
() => {
browserSync.init({
injectChanges: true,
proxy: "127.0.0.1:4000"
});
}
);
gulp.watch("scss/**/*.scss", siteSass).on("change", browserSync.reload);
gulp.watch("docs/**/*.html").on("change", browserSync.reload);
})
);
gulp.task("default", gulp.series("serve", disconnect));