Created
November 25, 2015 17:13
-
-
Save sergixnet/948c5c3dc9a54189bda2 to your computer and use it in GitHub Desktop.
Gulp file to compile sass, and 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
'use strict'; | |
var gulp = require('gulp'); | |
var browserSync = require('browser-sync').create(); | |
var sass = require('gulp-sass'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var autoprefixer = require('gulp-autoprefixer'); | |
gulp.task('css', function () { | |
return gulp.src('./scss/**/*.scss') | |
.pipe(sourcemaps.init()) | |
.pipe(sass().on('error', sass.logError)) | |
.pipe(autoprefixer({ browsers: ['last 2 version', 'ie >= 8', 'iOS >= 7', 'android >= 4.1'] })) | |
.pipe(gulp.dest('./css')); | |
}); | |
gulp.task('serve', function () { | |
browserSync.init({ | |
server: './' | |
}); | |
gulp.watch('./scss/**/*.scss', ['css']); | |
gulp.watch('./*.html').on('change', browserSync.reload); | |
}); | |
gulp.task('default', ['css', 'serve']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment