Guest User

Untitled

a guest
Jan 10th, 2019
81
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var gulp = require('gulp');
  2. var sass = require('gulp-sass');
  3. var connect = require('gulp-connect');
  4.  
  5. gulp.task('connect', function(){
  6. connect.server({
  7. root: 'sass',
  8. livereload: true
  9. });
  10. });
  11.  
  12. // keeps gulp from crashing for scss errors
  13. gulp.task('sass', function () {
  14. return gulp.src('./sass/*.scss')
  15. .pipe(sass({ errLogToConsole: true }))
  16. .pipe(gulp.dest('./sass/css'));
  17. });
  18.  
  19. gulp.task('livereload', function (){
  20. gulp.src('./sass/**/*')
  21. .pipe(connect.reload());
  22. });
  23.  
  24. gulp.task('watch', function () {
  25. gulp.watch('./sass/**/*.scss', ['sass']);
  26. gulp.watch('./sass/**/*', ['livereload']);
  27. });
  28.  
  29. gulp.task('default', ['connect', 'watch', 'sass']);
RAW Paste Data