Skip to content

Instantly share code, notes, and snippets.

@1stevengrant
Created July 30, 2015 09:41
Show Gist options
  • Save 1stevengrant/e0333e30015ceda94c70 to your computer and use it in GitHub Desktop.
Save 1stevengrant/e0333e30015ceda94c70 to your computer and use it in GitHub Desktop.
var gulp = require('gulp');
var browserSync = require('browser-sync');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var handleErrors = require('../util/handleErrors');
var config = require('../config').sass;
var autoprefixer = require('gulp-autoprefixer');
gulp.task('sass', function () {
return gulp.src(config.src)
.pipe(sourcemaps.init())
.pipe(sass(config.settings))
.on('error', handleErrors)
.pipe(autoprefixer({ browsers: ['last 2 version'] }))
.pipe(sourcemaps.write())
.pipe(gulp.dest(config.dest))
.pipe(browserSync.reload({stream:true}));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment