forked from PESTILLILAB/acnn-website
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
55 lines (42 loc) · 1.4 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
54
55
var gulp = require('gulp'),
util = require("gulp-util"),
sass = require('gulp-sass'),
browserSync = require('browser-sync').create(),
// livereload = require('gulp-livereload'),
// cssnano = require('gulp-cssnano'),
log = util.log;
var sassFiles = "docs/assets-main/css/*.scss";
gulp.task('sass', function () {
log("Generate CSS files " + (new Date()).toString());
gulp.src("docs/assets-main/css/styles.scss")
.pipe(sass({style: 'expanded'}))
.pipe(gulp.dest("docs/assets-main/css"))
;
log("Generated");
});
gulp.task('reload', function () {
// setTimeout(
// function(){
gulp.src("*")
.pipe(livereload());
// }, 1000);
});
gulp.task("watch", function () {
livereload.listen();
gulp.watch(["**/*.html", "**/*.twig", "php/*.php", "**/*.css", "**/*.scss", "**/*.md", "**/*.js"], ["reload"]);
console.log("Watching...");
});
gulp.task("watchsass", function () {
gulp.watch(sassFiles, ["sass"]);
console.log("Watching CSS...");
});
gulp.task('serve', function () {
browserSync.init({
server: "./docs"
});
//Uncomment if using SASS
// gulp.watch("scss/*.scss", ['sass']);
gulp.watch("./docs/*.html").on('change', browserSync.reload);
gulp.watch("./docs/css/*.css").on('change', browserSync.reload);
});
gulp.task('default', ['serve']);