Created
April 19, 2014 20:17
-
-
Save kevinSuttle/11096270 to your computer and use it in GitHub Desktop.
Sass + Jekyll + BrowserSync
This file contains hidden or 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
var gulp = require('gulp'); | |
var sass = require('gulp-sass'); | |
var uncss = require('gulp-uncss'); | |
var prefix = require('gulp-autoprefixer'); | |
var browserSync = require('browser-sync'); | |
gulp.task('sass', function () { | |
gulp.src('_sass/index.scss') | |
.pipe(sass({outputStyle: 'compressed'}, {errLogToConsole: true})) | |
.pipe(prefix("last 2 versions", "> 1%", "ie 8", "Android 2", "Firefox ESR")) | |
.pipe(gulp.dest('css')) | |
.pipe(browserSync.reload({stream:true})); | |
}); | |
gulp.task('jekyll', function () { | |
require('child_process').spawn('jekyll', ['build'], {stdio: 'inherit'}); | |
}); | |
gulp.task('browser-sync', function() { | |
browserSync.init(null, { | |
proxy: "localhost:4000" | |
}); | |
}); | |
gulp.task('default', ['sass', 'browser-sync'], function () { | |
require('child_process').spawn('jekyll', ['serve'], {stdio: 'inherit'}); | |
gulp.watch("_sass/*.scss", ['sass']); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment