Skip to content

Instantly share code, notes, and snippets.

@fallsimply
Created February 24, 2018 21:54
Show Gist options
  • Save fallsimply/fc2be8929bbd1b57a470096230d5a7bd to your computer and use it in GitHub Desktop.
Save fallsimply/fc2be8929bbd1b57a470096230d5a7bd to your computer and use it in GitHub Desktop.
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var sass = require('gulp-sass');
// Static Server + watching scss/html files
gulp.task('serve', ['sass'], function() {
browserSync.init({
server: "./app"
});
gulp.watch("*.sass", ['sass']);
gulp.watch("*.html").on('change', browserSync.reload);
});
// Compile sass into CSS & auto-inject into browsers
gulp.task('sass', function() {
return gulp.src("*.sass")
.pipe(sass())
.pipe(gulp.dest("./"))
.pipe(browserSync.stream());
});
gulp.task('default', ['serve']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment