-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
47 lines (40 loc) · 1.08 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
const gulp = require('gulp');
const sass = require('gulp-sass');
const jade = require('gulp-jade');
const pug = require('gulp-pug');
const plumber = require('gulp-plumber');
const notify = require('gulp-notify');
const browserSync = require('browser-sync');
const reload = browserSync.reload;
const BROWSER_SYNC_OPTIONS = {
server: ['src', './'],
port: 3000,
open: false
};
gulp.task('sass', function () {
gulp.src(['src/**/**/*.scss', '!src/**/**/_*.scss'])
.pipe(plumber({
errorHandler: notify.onError('<%= error.message %>')
}))
.pipe(sass({
pretty: true
}))
.pipe(gulp.dest('./'));
});
gulp.task('scss', ['sass'])
gulp.task('pug', () => {
return gulp.src(['src/pug/*.pug', '!src/pug/_*.pug'])
.pipe(plumber({
errorHandler: notify.onError('<%= error.message %>')
}))
.pipe(pug({
pretty: true
}))
.pipe(gulp.dest('./'));
});
gulp.task('build', ['sass', 'pug'])
gulp.task('watch', () => {
browserSync(BROWSER_SYNC_OPTIONS);
gulp.watch('src/styles/**/*.scss', ['sass', reload]);
gulp.watch('src/pug/*.pug', ['pug', reload]);
});