Skip to content

Instantly share code, notes, and snippets.

@rob-gordon
Created October 12, 2016 12:37
Show Gist options
  • Select an option

  • Save rob-gordon/a8e214bb0ede3fbd4045558ee27a227d to your computer and use it in GitHub Desktop.

Select an option

Save rob-gordon/a8e214bb0ede3fbd4045558ee27a227d to your computer and use it in GitHub Desktop.
Simple Sass / Browser-sync Gulpfile
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("app/scss/*.scss", ['sass']);
// gulp.watch("app/*.html").on('change', browserSync.reload);
// });
gulp.task('browser-sync', function() {
browserSync.init({
proxy: "http://globalgoalslab.dev"
});
gulp.watch("css/*.scss", ['sass']);
gulp.watch("templates/**.twig").on('change', browserSync.reload);
});
// Compile sass into CSS & auto-inject into browsers
gulp.task('sass', function() {
return gulp.src("css/*.scss")
.pipe(sass())
.pipe(gulp.dest("./css"))
.pipe(browserSync.stream());
});
gulp.task('default', ['browser-sync']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment