forked from pollockjj/arcane-artifex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
38 lines (30 loc) · 992 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
'use strict';
const gulp = require('gulp');
const sass = require('gulp-sass')(require('sass'));
var browserSync = require('browser-sync').create();
function buildStyles() {
return gulp.src('./scss/arcane-artifex.scss')
.pipe(sass({ outputStyle: 'compressed' }).on('error', sass.logError))
.pipe(gulp.dest('./css'))
.pipe(browserSync.stream());
};
function reloadTemplates() {
return () => {
browserSync.reload("templates/**/*.html");
}
}
exports.buildStyles = buildStyles;
exports.watch = function () {
browserSync.init(
{
server: false,
proxy: {
target: "https://localhost:443/",
ws: true,
}
}
);
gulp.watch("./templates/**/*.html").on('change', reloadTemplates);
gulp.watch("./templates/**/*.hbs").on('change', reloadTemplates);
gulp.watch(['./scss/**/*.scss', './scss/*.scss'], buildStyles);
};