Skip to content

Instantly share code, notes, and snippets.

@rightfold
Last active August 29, 2015 14:00
Show Gist options
  • Save rightfold/ffab5c9d30ef486299be to your computer and use it in GitHub Desktop.
Save rightfold/ffab5c9d30ef486299be to your computer and use it in GitHub Desktop.
#!/usr/bin/env coffee
glob = require('glob')
path = require('path')
LESS_FILES = ['static/css/style.less']
COFFEE_FILES = glob.sync('static/js/**/*.coffee')
DEBUG_MODE = '--debug' in process.argv[1..]
console.log """
builddir = build
"""
console.log """
rule lessc
command = lessc #{if DEBUG_MODE then '-O0' else '-O2'} $in $out
rule coffee
command = coffee -p $in > $out
"""
for less_file in LESS_FILES
console.log """
build $builddir/#{less_file}.css: lessc #{less_file}
"""
for coffee_file in COFFEE_FILES
console.log """
build $builddir/#{coffee_file}.js: coffee #{coffee_file}
"""
coffee configure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment