Skip to content

Instantly share code, notes, and snippets.

@biwin
Created November 18, 2015 15:45
Show Gist options
  • Save biwin/0abbba2ff4866bda3246 to your computer and use it in GitHub Desktop.
Save biwin/0abbba2ff4866bda3246 to your computer and use it in GitHub Desktop.
starts server on port 8000, compiles sass and reloads on filechanges.
var gulp = require('gulp'),
sass = require('gulp-sass'),
connect = require('gulp-connect');
connect.server({port: 8000, livereload: true});
gulp.task('sass', function () {
gulp.src('scss/*.scss')
.pipe(sass({outputStyle: 'compressed'}))
.pipe(gulp.dest('css'));
});
gulp.task('reload', function () {
gulp.src('*.html')
.pipe(connect.reload());
});
gulp.task('default', function() {
gulp.watch(['*.html'],['reload']);
gulp.watch('scss/*.scss', ['sass','reload']);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment