 ]
 coffeeDistFiles = [_.extend({}, coffeeFiles[0], {dest: 'dist'})]
 
+globFiles = [
+  expand: true
+  cwd: 'tmp'
+  src: ['**/*.html']
+  dest: 'tmp'
+  ext: '.html'
+]
+globDistFiles = [_.extend({}, globFiles[0], {dest: 'dist', cwd: 'dist'})]
+
 
 module.exports = (grunt) ->
   require('load-grunt-tasks')(grunt)

          livereload: true

    copy:
      devAssets:
        expand: true
        cwd: 'assets'
        src: ['**/*', '!css/**/*.<%= cssExt %>', '!js/**/*.coffee']
        dest: 'tmp'
      devComponents:
          expand: true
          cwd: '.components'
          src: ['**/*', '!**/src/**']

    watch:
      assets:
        files: ['assets/**/*', '!assets/css/**/*.<%= cssExt %>','!assets/js/**/*.coffee']
        tasks: ['newer:copy:tmpAssets']
        options:
          event: ['changed']
      assetsGlob:
        files: ['assets/**/*', '!assets/css/**/*.<%= cssExt %>', '!assets/js/**/*.coffee']
        tasks: ['copy:tmpAssets', 'brerror:<%= htmlTask %>:tmp', 'glob:tmp']
        options:
          event: ['added', 'deleted']
      coffee:
        cwd: 'assets/js'
        files: 'assets/js/**/*.coffee'
        tasks: ['brerror:newer:coffee:tmp']
        options:
          event: ['changed']
      coffeeGlob:
        cwd: 'assets/js'
        files: 'assets/js/**/*.coffee'
        tasks: ['brerror:newer:coffee:tmp', 'brerror:<%= htmlTask %>:tmp', 'glob:tmp']
        options:
          event: ['added', 'deleted']
      stylesheets:
        cwd: 'assets/css'
        files: 'assets/css/**/*.<%= cssExt %>'
        tasks: ['brerror:newer:<%= cssTask %>:tmp']
        options:
          event: ['changed']
      stylesheetsGlob:
        cwd: 'assets/css'
        files: 'assets/css/**/*.<%= cssExt %>'
        tasks: ['brerror:newer:<%= cssTask %>:tmp', 'brerror:<%= htmlTask %>:tmp', 'glob:tmp']
        options:
          event: ['added', 'deleted']
      views:
        cwd: 'views'
        files: 'views/**/*.<%= htmlExt %>'
        tasks: ['brerror:newer:<%= htmlTask %>:tmp', 'glob:tmp']
      options:
        livereload: livereloadPort

    coffee:
      tmp:
        files: coffeeFiles
      dev:
        files: coffeeDistFiles
      dist:
        files: coffeeDistFiles

<% if(options.css === 'stylus') { %>
    stylus:
      tmp:
        files: cssFiles
        options:
          compress: false
      dev:
        files: cssDistFiles
        options:
          compress: false
      dist:
        files: cssDistFiles
      options:
        use: [
          require 'axis-css'
        ]
<% } else if(options.css === 'less') { %>
    less:
      tmp:
        files: cssFiles
      dev:
        files: cssDistFiles
      dist:
        files: cssDistFiles
        options:
          compress: true
<% } if(options.html === 'jade') { %>
    jade:
      tmp:
        files: htmlFiles
        options:
          pretty: true
      dev:
        files: htmlDistFiles
        options:
          pretty: true
      dist:
