Skip to content

Instantly share code, notes, and snippets.

@brianpurkiss
Created July 6, 2016 16:27
Show Gist options
  • Save brianpurkiss/e7b9f88506744f33c6a81d4c07ef0803 to your computer and use it in GitHub Desktop.
Save brianpurkiss/e7b9f88506744f33c6a81d4c07ef0803 to your computer and use it in GitHub Desktop.
This gulp file's primary purpose is SASS compiling. It includes an auto compressor, prefixer, and watcher.
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
// primary gulp build
gulp.task('sass', function () {
return gulp
.src('*.scss')
.pipe(sass(
{outputStyle: 'compressed'}
).on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(gulp.dest(''));
});
// gulp watch
// watches the CSS folder and all nested folders
gulp.task('sassWatch', function () {
gulp.watch(['*.scss','../bootstrap/stylesheets/*.scss','../bootstrap/stylesheets/**/*.scss'], ['sass']);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment