-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
50 lines (39 loc) · 1.21 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
48
49
50
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var $ = require('gulp-load-plugins')();
var path = {
SCSS_SRC : './scss/**/*.scss',
SCSS_DST : './css',
CSS_JKDST : './docs/css',
HTML_SRC : ['./*.html','./_post/*.*','./_layouts/*.*', './_includes/*.*'],
}
gulp.task('scss', function () {
gulp.src( path.SCSS_SRC )
.pipe($.sourcemaps.init())
.pipe($.sass())
.pipe($.autoprefixer({ browsers: ['last 2 versions'], cascade: false }))
.pipe($.size({ showFiles: true }))
.pipe($.csso())
.pipe($.size({ showFiles: true }))
.pipe($.sourcemaps.write('map'))
.pipe(gulp.dest( path.SCSS_DST ))
.pipe(gulp.dest( path.CSS_JKDST ))
.pipe(browserSync.stream({ match: '**/*.css' }))
;
});
gulp.task('jekyll', function () {
require('child_process').exec('jekyll build --baseurl=', {stdio: 'inherit'}, function(){
browserSync.reload();
});
});
gulp.task('serve', function() {
browserSync.init({
server: {
baseDir: "./docs/"
}
});
gulp.watch(path.SCSS_SRC, ['scss', 'jekyll']);
gulp.watch(path.HTML_SRC, ['jekyll']);
gulp.watch(path.HTML_SRC).on('change', browserSync.reload);
});
gulp.task('default', ['scss','jekyll','serve']);