-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
41 lines (38 loc) · 941 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
36
37
38
39
40
41
/*
* Dependencies
*/
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
pump = require('pump'),
shell = require('gulp-shell'),
browserSync = require('browser-sync').create();
/*
* Task for building _site when something changed
*/
gulp.task('build', shell.task(['bundle exec jekyll build --watch']));
// Or if you don't use bundle:
// gulp.task('build', shell.task(['jekyll build --watch']));
/*
* Task for serving _site 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);
});
/*
* Compress js files
*/
gulp.task('compress', function (cb) {
pump([
gulp.src('assets/js/*.js'),
uglify(),
gulp.dest('assets/js-min')
],
cb
);
});
/*
* Default Task
*/
gulp.task('default', ['compress', 'build', 'serve']);