dat.gui/gulpfile.js
George Michael Brower 1b5100e8e4 gulp
2014-08-15 12:32:49 -04:00

34 lines
766 B
JavaScript

/* jshint node: true */
"use strict";
var gulp = require("gulp"),
stylus = require("gulp-stylus"),
nib = require("nib"),
watch = require("gulp-watch"),
argv = require("yargs").argv
function compileCss() {
var deferred = Q.defer();
gulp.src("elements/*.styl")
.pipe(stylus({use: [nib()]}))
.pipe(gulp.dest("elements"))
.on("end", function() {
deferred.resolve();
});
return deferred.promise;
}
gulp.task("stylus", function () {
if (argv.watch) {
watch({glob: "elements/*.styl"}, function(files) {
return files
.pipe(stylus({use: [nib()]}))
.pipe(gulp.dest("elements"));
});
} else {
return compileCss();
}
});