Skip to content

Instantly share code, notes, and snippets.

@kellishouts
Created June 23, 2015 07:07
Show Gist options
  • Save kellishouts/3e171e2728037e5721e3 to your computer and use it in GitHub Desktop.
Save kellishouts/3e171e2728037e5721e3 to your computer and use it in GitHub Desktop.
Basic Gulpfile - Livereload and Sass
var gulp = require('gulp');
var sass = require('gulp-sass');
var connect = require('gulp-connect');
gulp.task('connect', function(){
connect.server({
root: 'public',
livereload: true
});
});
// keeps gulp from crashing for scss errors
gulp.task('sass', function () {
return gulp.src('./sass/*.scss')
.pipe(sass({ errLogToConsole: true }))
.pipe(gulp.dest('./public/css'));
});
gulp.task('livereload', function (){
gulp.src('./public/**/*')
.pipe(connect.reload());
});
gulp.task('watch', function () {
gulp.watch('./sass/**/*.scss', ['sass']);
gulp.watch('./public/**/*', ['livereload']);
});
gulp.task('default', ['connect', 'watch', 'sass']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment