       log.info "Watching for changes..." if initial
       setTimeout =>
         @compileChanged options, false
-      , 1000
+      , 250
 
   readIncludesFile: ->
     includesFile = @config.client.includesPath + "/includes.coffee"


  buildJS: (options)->
    js = "var KD = {}; KD.config = #{JSON.stringify(@config.client.runtimeOptions)}; (function(){ "
    lineOffset = 0
    sourceMap = new SourceMap.SourceMapGenerator file: @config.client.js, sourceRoot: @config.client.runtimeOptions.sourceUri
    for file in @scripts
      contentLineCount = file.content.split("\n").length
      new SourceMap.SourceMapConsumer(file.sourceMap).eachMapping (mapping)->
        sourceMap.addMapping
          generated:
            line: lineOffset + mapping.generatedLine
            column: mapping.generatedColumn
          original:
            line: mapping.originalLine
            column: mapping.originalColumn
          source: file.includePath
      js += file.content + "\n"
      lineOffset += contentLineCount
    js += "}).call(this);\n//@ sourceMappingURL=/#{@config.client.js}.map"

    fs.writeFileSync @config.client.websitePath + "/" + @config.client.js, js
    fs.writeFileSync @config.client.websitePath + "/" + @config.client.js + ".map", sourceMap.toString()
    log.info "Build complete: #{@config.client.js}"

  buildCSS: (options)->

    if sourceTime <= file.cacheTime
      if not file.content?
        file.content = fs.readFileSync file.cachePath, "utf-8"
        if fs.existsSync file.sourceMapPath
          sourceMapJSON = fs.readFileSync file.sourceMapPath, "utf-8"
          file.sourceMap = new SourceMap.SourceMapConsumer(sourceMapJSON)._generatedMappings
      return false

    source = fs.readFileSync file.sourcePath, "utf-8"
