Skip to content

Instantly share code, notes, and snippets.

Created May 25, 2016 19:53
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Automate compiling Sass to CSS and browser refresh using BrowserSync
// Require our dependencies
var gulp = require('gulp');
var sass = require('gulp-sass');
var browserSync = require('browser-sync').create();
gulp.task('styles', function(){
return gulp.src('sass/style.scss')
outputStyle: 'expanded', // Options: nested, expanded, compact, compressed
indentType: 'tab',
indentWidth: 1
})) // Converts Sass to CSS with gulp-sass
.pipe(browserSync.reload({stream: true}));
// Gulp watch syntax
gulp.task('serve', function(){
// Kick off BrowserSync.
proxy: ""
});'sass/**/*.scss', ['styles']);
// Default Gulp task
gulp.task('default',['styles', 'serve']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment