Created
January 11, 2015 01:55
-
-
Save TylerK/d61539c840460d989e32 to your computer and use it in GitHub Desktop.
This file contains 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
// | |
// Main Stylus task | |
//--------------------------------------------------------- | |
var gulp = require('gulp') | |
, config = require('../../configs/gulp-config') | |
, path = require('path') | |
, nib = require('nib') | |
, stylus = require('gulp-stylus') | |
, plumber = require('gulp-plumber') | |
, notify = require('gulp-notify') | |
, sync = require('browser-sync') | |
, reload = sync.reload | |
; | |
// | |
// Stylus task | |
//--------------------------------------------------------- | |
gulp.task('stylus:dev', function () { | |
var compileStylus = function (_config) { | |
console.log('Compiling Stylus:', _config.src) | |
return gulp.src(_config.src) | |
.pipe(stylus({ | |
use: nib() | |
, sourcemap: { | |
inline: true | |
, sourceRoot: '.' | |
, basePath: _config.dest | |
} | |
, compress: false | |
, linenos: false | |
})) | |
.pipe(gulp.dest(_config.dest)) | |
.pipe(reload({ stream: true })); | |
}; | |
Object.keys(config.styles).forEach(function (_styles) { | |
compileStylus(config.styles[_styles]); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment