Skip to content

Instantly share code, notes, and snippets.

@delebash
Created April 20, 2015 02:15
Show Gist options
  • Save delebash/21bbd1b9cdc27f1fca04 to your computer and use it in GitHub Desktop.
Save delebash/21bbd1b9cdc27f1fca04 to your computer and use it in GitHub Desktop.
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']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment