Created
July 4, 2012 13:37
-
-
Save tsyber1an/3047383 to your computer and use it in GitHub Desktop.
cake with minify and coffee watcher
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs = require 'fs' | |
{print} = require 'sys' | |
{exec} = require 'child_process' | |
{spawn} = require 'child_process' | |
option '-o', '--output [DIR]', 'output dir' | |
task 'minify', 'Minify mongo production scripts', -> | |
exec 'uglifyjs --overwrite lib/mongo/lib/*.js', (err, stdout, stderr) -> | |
throw err if err | |
console.log stdout + stderr | |
task 'watch', 'Watch lib/mongo/src for changes', -> | |
coffee = spawn 'coffee', ['-w', '-c', '-o', 'lib/mongo/lib', 'lib/mongo/src'] | |
coffee.stderr.on 'data', (data) -> | |
process.stderr.write data.toString() | |
coffee.stdout.on 'data', (data) -> | |
print data.toString() | |
invoke 'minify' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment