     '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.")
+      fs.writeFileSync(templates_source, "templates =\n#{tmpl}\n")
+      grunt.log.writeln("File #{templates_source} created.")
     )
 
   grunt.registerTask('all', [

    "src/coffee/validators/*.coffee",
    "src/coffee/services/*.coffee"]
  html_sources =  "src/html/*.html"
  sources = coffee_sources.concat ["src/coffee/templates.coffee"]

  config =
    pkg: grunt.file.readJSON('package.json')

## This file is subject to the terms and conditions defined in
## file 'LICENSE.txt', which is part of this source code package.
## 

fs = require('fs')
path = require('path')
glob = require("glob")

module.exports = (grunt) ->

