Created
June 23, 2015 07:07
-
-
Save kellishouts/3e171e2728037e5721e3 to your computer and use it in GitHub Desktop.
Basic Gulpfile - Livereload and Sass
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
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