         stdout: true
         stderr: true
         failOnError: true
+      coffee:
+        command: "./node_modules/.bin/coffee -co build/ source/"
       lexer:
         command: [
           "jison-lex -o build/lexer.js source/haml.jisonlex"

module.exports = (grunt) ->

  coffeeFiles = {}
  [
    "browser"
    "cli"
    "compiler"
    "demo"
    "gistquire"
    "grammar_dsl"
    "haml-jr"
    "runtime"
  ].forEach (name) ->
    destination = "build/#{name}.js"
    source = "source/#{name}.coffee"
    coffeeFiles[destination] = source

  # Project configuration.
  grunt.initConfig
    pkg: grunt.file.readJSON('package.json')

    coffee:
      compile:
        files: coffeeFiles

    uglify:
      web:

  grunt.registerTask 'build', [
    'shell:lexer'
    'shell:parser'
    'shell:coffee'
    'browserify'
    'uglify'
    'shell:demo'
