Created
January 10, 2015 12:49
-
-
Save monnoval/139cb9806c4a8a11e114 to your computer and use it in GitHub Desktop.
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
// Project configuration | |
var project = 'bare' | |
, build = './build/' | |
, dist = './dist/' | |
, source = './src/' // 'source' instead of 'src' to avoid confusion with gulp.src | |
, lang = 'languages/' | |
, fonts = 'fonts/' | |
, bower = './bower_components/' | |
; | |
// Initialization sequence | |
var gulp = require('gulp') | |
, gutil = require('gulp-util') | |
, plugins = require('gulp-load-plugins')({ camelize: true }) // This loads all modules prefixed with "gulp-" to plugin.moduleName | |
, del = require('del') | |
, lazypipe = require('lazypipe') | |
, merge = require('merge-stream') | |
; | |
var styles_sass = lazypipe() | |
.pipe( plugins.sass, { | |
includePaths: [bower, source+'scss'], | |
errLogToConsole: true | |
}) | |
.pipe( plugins.autoprefixer, | |
'last 2 versions', 'ie 9', 'ios 6', 'android 4'); | |
var styles_min = lazypipe() | |
.pipe( plugins.rename, { suffix: '.min' }) | |
.pipe( plugins.minifyCss, { keepSpecialComments: 1 }); | |
var onError = function(err) { console.log(err) } | |
gulp.task('styles', function() { | |
return gulp.src([source+'scss/*.scss', '!'+source+'scss/_*.scss']) | |
.pipe(styles_sass().on('error', onError)) | |
.pipe(gulp.dest(build)) | |
.pipe(styles_min().on('error', onError)) | |
.pipe(gulp.dest(build)) | |
}); | |
gulp.task('default', ['styles']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment