     # Determine if we need to copy/compile
     # the file into the staticRoot folder
     if (file.indexOf(@options.staticRoot) == -1 or @_needsCompiling(file))
-      writeTo = path.normalize(@_convertFilename(@options.staticRoot + '/generated/' + relativeFile))
+      writeTo = path.normalize(@_convertFilename("#{@options.staticRoot}/#{@defaultCompiledDir}/#{relativeFile}"))
       needsCompiling = true
       file = writeTo
       relativeFile = @_getRelativePath(file)


      str = @minify(str)
      hash = crypto.createHash('md5').update(str).digest('hex')
      filepath = "#{@options.staticRoot}/generated/bundle/#{hash.substring(0, 7)}_#{namespace}#{@fileExtension}"

      writeToFile(filepath, str)


        break
    return relativePath

  #
  # Determines based on file extension
  # if the file needs to get compiled
  #
  _needsCompiling: (file) ->
