Skip to content

Instantly share code, notes, and snippets.

@theblacksquid
Created August 15, 2016 10:05
Show Gist options
  • Save theblacksquid/db958c1d45d6b9ef1b4ee5e56cf854b6 to your computer and use it in GitHub Desktop.
Save theblacksquid/db958c1d45d6b9ef1b4ee5e56cf854b6 to your computer and use it in GitHub Desktop.
{exec} = require 'child_process'
task 'bake-dev', 'Build project from src/*.coffee to lib/*.js', ->
exec 'cat src/* | coffee --compile --stdio > lib/bundle.js', (err, stdout, stderr) ->
throw err if err
console.log stdout + stderr
console.log 'baking done. Development flavor.'
task 'bake-prod', 'Build project for production use. Compresses lib/bundle.js', ->
exec 'cat src/* | coffee --compile --stdio | uglifyjs - -c -m > lib/app.js', (err, stdout, stderr) ->
throw err if err
console.log stdout + stderr
console.log 'baking done. Production flavor.'
task 'check', 'Run files through CoffeeLint for errors and/or style warnings', ->
exec 'coffeelint src/*.coffee', (err, stdout, stderr) ->
console.log stdout
console.log 'Finished checking the brew'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment