mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
34 lines
766 B
JavaScript
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();
|
|
}
|
|
});
|