Created
May 14, 2015 14:32
-
-
Save KOWLOR/ea896192d41a43e8599f to your computer and use it in GitHub Desktop.
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
// Include gulp | |
var gulp = require('gulp'); | |
var plumber = require('gulp-plumber'); | |
// Include Our Plugins | |
var sass = require('gulp-sass'), | |
minifyCSS = require('gulp-minify-css'), | |
autoprefixer = require('gulp-autoprefixer'), | |
gutil = require('gulp-util'); | |
// Error handling with plumber | |
var onError = function (err) { | |
gutil.beep(); | |
console.log(err); | |
this.emit('end'); | |
}; | |
// Compile Our Sass | |
gulp.task('sass', function() { | |
return gulp.src('app/assets/stylesheets/src/**/*.scss') | |
.pipe(plumber({ errorHandler: onError })) | |
.pipe(sass()) | |
.pipe(autoprefixer({ | |
browsers: ['last 20 versions'], | |
cascade: false | |
})) | |
.pipe(minifyCSS({keepBreaks:false})) | |
.pipe(gulp.dest('app/assets/stylesheets/dist')); | |
}); | |
// Watch Files For Changes | |
gulp.task('watch', function() { | |
gulp.watch('app/assets/stylesheets/src/**/*.scss', ['sass']); | |
}); | |
// Default Task | |
gulp.task('default', ['sass', 'watch']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment