-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
executable file
·47 lines (38 loc) · 974 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
42
43
var gulp = require('gulp');
var requireDir = require('require-dir');
var browserSync = require('browser-sync');
requireDir('./_gulp-tasks');
//gulp默认指令 打包-同步-监听
gulp.task('default', ['browser-sync', 'watch']);
//服务端
gulp.task('build', ['server-js', 'server-sass', 'server-jekyll']);
//task
gulp.task('browser-sync', ['js', 'sass', 'img', 'jekyll'], function (cb) {
browserSync({server: {baseDir: 'dist'}});
cb();
});
gulp.task('watch', ['browser-sync'], function () {
gulp.watch([
'_scss/**/*.scss',
'img/**/*.scss'
], ['sass']);
//js
gulp.watch([
'_js/**/*.js'
], ['js']);
//image
gulp.watch([
'img/**/*.png',
'img/**/*.gif',
'img/**/*.jpg',
'img/**/*.svg'
], ['img']);
//jekyll
gulp.watch([
'index.md',
'_includes/*',
'_layouts/*',
'_data/*.yml',
'pages/**/*',
], ['jekyll-rebuild']);
});