forked from matt-curtis/developer.sketchapp.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
37 lines (33 loc) · 1.31 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
var browserSync = require('browser-sync').create()
var exec = require('child_process').exec
var gulp = require('gulp')
var runSequence = require('run-sequence') // This is temporary, until Gulp 4.0 ships with support for sequential tasks
gulp.task('build:jekyll', function(callback) {
exec('jekyll build --incremental', function(err, stdout, stderr){
callback(err)
})
})
gulp.task('watch', function() {
return exec('jekyll build --incremental --watch', function(err, stdout, stderr) {
if (err) {
console.log(err, stdout, stderr)
}
})
})
gulp.task('serve', function() {
return browserSync.init({
server: "./_site",
files: './_site/**/*.*',
notify: false,
logPrefix: 'developer.sketchapp.com',
// Uncomment the next two lines to create a tunnel to https://developersketchapp.localtunnel.me
// tunnel: 'developersketchapp',
// online: true, // Set this to 'false' when working with no connection
open: 'external', // Can use 'local', 'external' or 'tunnel' (last one opens https://developersketchapp.localtunnel.me)
// Uncomment the next line if you want Gulp to open multiple browsers when running
// browser: ['google chrome', 'safari', 'firefox']
})
})
gulp.task('default', function(callback){
runSequence('build:jekyll', 'watch', 'serve')
})