Last active
May 17, 2016 04:53
-
-
Save firhatsungkar/8681efb312a7829a75352b62b33ca921 to your computer and use it in GitHub Desktop.
My Gulpfile
This file contains hidden or 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'; | |
// Gulp Plugins | |
var gulp = require('gulp'), | |
sass = require('gulp-sass'), | |
livereload = require('gulp-livereload'), | |
autoprefixer = require('gulp-autoprefixer'); | |
// Gulp Config | |
var input = 'scss/**/*.scss', | |
output = 'css', | |
sassConfig = { | |
errLogToConsole: true, | |
outputStyle: 'expanded' | |
}, | |
autoprefixerConfig = { | |
browsers: ['last 2 versions'], | |
cascade: false | |
} | |
// Run gulp task | |
gulp.task('sass', function () { | |
gulp.src(input) | |
.pipe(sass(sassConfig).on('error', sass.logError)) | |
.pipe(autoprefixer(autoprefixerConfig)) | |
.pipe(gulp.dest(output)) | |
.pipe(livereload()); | |
}); | |
gulp.task('sass:watch', function () { | |
livereload.listen(); | |
gulp.watch(input, ['sass']); | |
}); | |
// Gulp default | |
gulp.task('default',['sass:watch']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment