Skip to content

Instantly share code, notes, and snippets.

@Raynos
Last active January 2, 2016 01:29
Show Gist options
  • Save Raynos/8230606 to your computer and use it in GitHub Desktop.
Save Raynos/8230606 to your computer and use it in GitHub Desktop.
// don't pass monk in as an argument, just require it
var monk = require("monk")
var rule = require("monk/rule")
var less = require("monk-less");
var compress = require("monk-compress")
// don't exports.x = bar
// just create functions.
function build() {
// don't have magic glob or mapFile. Just have sensible defaults
// in your string DSL.
// alternatively
// var glob = require("monk/glob"), explode = require("monk/explode")
// rule(glob("*.less"), explode("css/%f.css"), less())
rule("*.less", "css/%f.css", less())
}
function dist() {
rule("css/*.css", ["dist.bz2", "dist.tar.gz"], compress())
}
// export a single thing, a list of two tasks
// the all task is considered 'default' like make.
module.exports = {
build: build,
dist: dist,
all: build
}
if (require.main === module) {
monk(module.exports);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment