-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
45 lines (35 loc) · 1.15 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
'use strict';
const gulp = require('gulp');
const sass = require('gulp-sass');
const pug = require('gulp-pug');
var browserSync = require('browser-sync').create();
gulp.task('serve', ['sass', 'pug', 'pug-projects'], function() {
browserSync.init({
server: "./",
serveStaticOptions: {
extensions: ['html']
}
});
gulp.watch("./src/scss/*.scss", ['sass']).on('change', browserSync.reload);
gulp.watch("./src/views/*.pug", ['pug']).on('change', browserSync.reload);
gulp.watch("./src/views/projects/*.pug", ['pug-projects']).on('change', browserSync.reload);
});
gulp.task('pug', function() {
return gulp.src("./src/views/*.pug")
.pipe(pug())
.pipe(gulp.dest("./"))
.pipe(browserSync.stream());
});
gulp.task('pug-projects', function() {
return gulp.src("./src/views/projects/*.pug")
.pipe(pug())
.pipe(gulp.dest("./projects"))
.pipe(browserSync.stream());
});
gulp.task('sass', function() {
return gulp.src("./src/scss/*.scss")
.pipe(sass())
.pipe(gulp.dest("./css"))
.pipe(browserSync.stream());
});
gulp.task('default', ['serve']);