Created
October 12, 2016 12:37
-
-
Save rob-gordon/a8e214bb0ede3fbd4045558ee27a227d to your computer and use it in GitHub Desktop.
Simple Sass / Browser-sync Gulpfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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