Created
April 20, 2015 02:15
-
-
Save delebash/21bbd1b9cdc27f1fca04 to your computer and use it in GitHub Desktop.
sass2
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
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