Created
August 2, 2014 12:13
-
-
Save anonymous/96d03c316f5bd6d51878 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var gulp = require('gulp'); | |
var browserSync = require('browser-sync'); | |
var reload = browserSync.reload; | |
var exec = require('child_process').exec; | |
var run = function(command, done) { | |
exec(command, function(error) { | |
if (error) { | |
return done(error); | |
}; | |
done(); | |
}); | |
}; | |
gulp.task('compass', function(done) { | |
// A `config.rb` file must be present in the same directory of this file. | |
run('bundle exec compass compile .', done); | |
}); | |
gulp.task('jekyll', ['compass'], function(done) { | |
// Compile Jekyll into `dist`. This task executes the `compass` task each time, | |
// it could be optimized to only execute it if SASS files are changed. | |
run('bundle exec jekyll build', done); | |
}); | |
gulp.task('serve', function() { | |
browserSync({ | |
notify: false, | |
server: { | |
baseDir: ['dist'] | |
} | |
}); | |
gulp.watch(['src/**/*'], ['jekyll', reload]); | |
}); | |
gulp.task('development', ['serve']); | |
gulp.task('default', ['jekyll']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment