     "src/coffee/validators/*.coffee",
     "src/coffee/services/*.coffee"]
   html_sources =  "src/html/*.html"
-  sources = coffee_sources.concat ["src/coffee/templates.coffee"]
+  templates_source = "src/coffee/templates.coffee"
+  sources = coffee_sources.concat [templates_source]
 
   config =
     pkg: grunt.file.readJSON('package.json')

    'templates',
    'Generate a coffeescript files containing the html templates.',
    ->
      dest = 'src/coffee/templates.coffee'
      tmpl = "templates =\n"
      fs = require('fs')
      path = require('path')
      glob = require("glob")
      for f in glob.sync(html_sources)
        name = (path.basename(f, '.html'))
        content = fs.readFileSync(f)
        tmpl += "  #{name}: \"\"\"#{content}\"\"\"\n"
      fs.writeFileSync(dest, tmpl)
      grunt.log.writeln("File #{dest} created.")
    )

  grunt.registerTask('all', [

    'uglify'])

  grunt.registerTask('default', ['all'])
  grunt.registerTask('test', ['karma'])
  grunt.registerTask('server', ['all', 'connect', 'watch'])
  grunt.registerTask('dev', ['all', 'connect', 'watch'])
