-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
28 lines (24 loc) · 931 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
var gulp = require('gulp');
var shell = require('gulp-shell');
var sass = require('gulp-sass');
var browserSync = require('browser-sync').create();
// Task for building blog when something changed:
gulp.task('build', shell.task(['jekyll build --watch -I']));
// Or if you don't use bundle:
// gulp.task('build', shell.task(['jekyll build --watch']));
gulp.task('styles', function() {
gulp.src('_sass/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('assets/css/'))
});
//Watch task
gulp.task('sass:watch',function() {
gulp.watch('_sass/**/*.scss',['styles']);
});
// Task for serving blog with Browsersync
gulp.task('serve', function () {
browserSync.init({server: {baseDir: '_site/'}});
// Reloads page when some of the already built files changed:
gulp.watch('_site/**/*.*').on('change', browserSync.reload);
});
gulp.task('default', ['sass:watch', 'build', 'serve']);