-
Notifications
You must be signed in to change notification settings - Fork 6
/
Gulpfile.js
35 lines (30 loc) · 940 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
'use strict';
// Task Dependencies
const gulp = require('gulp');
const sass = require('gulp-sass');
const pug = require('gulp-pug');
// Default task, runs css and pug tasks
gulp.task('default', ['css', 'pug']);
// CSS task, compiles SCSS into CSS in the assets directory
gulp.task('css', () => {
gulp.src('./src/scss/styles.scss')
.pipe(sass({
includePaths: [
require('bourbon').includePaths,
require('bourbon-neat').includePaths
],
outputStyle: 'compressed'
}).on('error', sass.logError))
.pipe(gulp.dest('./assets/css'));
});
// Pug task, compiles pug templates into root directory of repository
gulp.task('pug', () => {
gulp.src('./src/views/*.pug')
.pipe(pug())
.pipe(gulp.dest('./'));
});
// Watch task, watches css and pug files and runs tasks on changes
gulp.task('watch', () => {
gulp.watch('./src/scss/**/*', ['css']);
gulp.watch('./src/views/**/*', ['pug']);
});