Created
December 29, 2015 06:11
-
-
Save ayezee33/f0e05aa5b55f9145c2c6 to your computer and use it in GitHub Desktop.
Foundation 6 Starter Template Gulpfile with Browsersync
This file contains 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 $ = require('gulp-load-plugins')(); | |
var browserSync = require('browser-sync').create(); | |
var sass = require('gulp-sass'); | |
var reload = browserSync.reload; | |
var sassPaths = [ | |
'bower_components/foundation-sites/scss', | |
'bower_components/motion-ui/src' | |
]; | |
gulp.task('sass', function() { | |
return gulp.src('scss/app.scss') | |
.pipe($.sass({ | |
includePaths: sassPaths | |
}) | |
.on('error', $.sass.logError)) | |
.pipe($.autoprefixer({ | |
browsers: ['last 2 versions', 'ie >= 9'] | |
})) | |
.pipe(gulp.dest('css')) | |
.pipe(browserSync.stream()); | |
}); | |
// Static Server + watching scss/html files | |
gulp.task('serve', ['sass'], function() { | |
browserSync.init({ | |
server: "./" | |
}); | |
gulp.watch("./scss/*.scss", ['sass']); | |
gulp.watch("/*.html").on('change', browserSync.reload); | |
}); | |
gulp.task('default', ['serve']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am running a MAMP site and this worked for me
https://gist.github.com/petergus/31d75a5145e062d4eaa42eb04ce23aea