Skip to content

Instantly share code, notes, and snippets.

@ixahmedxi
Created February 23, 2018 09:47
Show Gist options
  • Save ixahmedxi/d347eb52c4754cedd82ad4beb68578e5 to your computer and use it in GitHub Desktop.
Save ixahmedxi/d347eb52c4754cedd82ad4beb68578e5 to your computer and use it in GitHub Desktop.
Gulp Browser Sync with sass compiling
const gulp = require('gulp')
const browserSync = require('browser-sync').create()
gulp.task('browser-sync', ['sass'], () => {
browserSync.init({
server: {
baseDir: "./"
}
})
// watch the scss files for change to reload the server
gulp.watch("app/scss/*.scss", ['sass'])
})
gulp.task('sass', function() {
return gulp.src("app/scss/*.scss")
.pipe(sass())
.pipe(gulp.dest("app/css"))
.pipe(browserSync.stream())
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment