Skip to content

Instantly share code, notes, and snippets.

@TylerK
Created January 11, 2015 01:55
Show Gist options
  • Save TylerK/d61539c840460d989e32 to your computer and use it in GitHub Desktop.
Save TylerK/d61539c840460d989e32 to your computer and use it in GitHub Desktop.
//
// 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