incdec/gulpfile.js

34 lines
862 B
JavaScript

var gulp = require("gulp");
var clean = require("gulp-clean");
var coffee = require("gulp-coffee");
var stylus = require("gulp-stylus");
// gulp-clean seems to not like exporting the function
gulp.task("clean", function(){
return gulp.src("./build", {read: false, allowEmpty: true})
.pipe(clean());
});
function server(cb){
gulp.src("./index.coffee")
.pipe(coffee({bare: true}))
.pipe(gulp.dest("./build"));
cb();
}
function client(cb){
gulp.src("./static/app.coffee")
.pipe(coffee({bare: true}))
.pipe(gulp.dest("./build/static"));
gulp.src("./static/index.html")
.pipe(gulp.dest("./build/static"));
gulp.src("./static/app.styl")
.pipe(stylus())
.pipe(gulp.dest("./build/static"));
cb();
}
exports.server = server;
exports.client = client;
exports.default = gulp.series("clean", gulp.parallel(server, client));