dat.gui/gulpfile.js

34 lines
766 B
JavaScript
Raw Normal View History

2014-08-15 16:32:49 +00:00
/* 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();
}
});