delebash
4/20/2015 - 2:15 AM

sass2

sass2

var gulp = require('gulp');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');

var config = {
    sassPath: './src/sass/',
    bowerDir: './bower_components',
    autoprefixer: {
        cascade: true
    },
    paths: {
        output: 'dist/'
    }
}

//TODO:
//if(/prod/.test(env)) {
//    config.sass.outputStyle = 'compressed';
//}

gulp.task('sass', function() {
    gulp.src(config.sassPath + '**/*.scss')
        .pipe(sourcemaps.init())
        .pipe(sass({
            style: 'expanded',
            includePaths: [
                config.sassPath,
                config.bowerDir + '/bootstrap-sass-official/assets/stylesheets',
            ],
            errLogToConsole: true }))
        //.pipe(autoprefixer(config.autoprefixer))
        .pipe(sourcemaps.write('./maps'))
        .pipe(gulp.dest(config.paths.output))
});

// Rerun the task when a file changes
gulp.task('watch', function() {
    gulp.watch(config.sassPath + '/**/*.scss', ['sass']);
});

gulp.task('default', ['sass']);