         dependent.dependencies.length > 0
       .filter (dependent) =>
         path in dependent.dependencies
+      .filter (dependent) =>
+        dependent not in @compiled
       .forEach(@compile)
 
   compile: (file) =>
-    @compiling.push(file)
-    file.compile (error) =>
-      @compiling.splice @compiling.indexOf(file), 1
+    if @compiling.indexOf(file) == -1
+      @compiling.push(file)
+      file.compile (error) =>
+        @compiling.splice @compiling.indexOf(file), 1
+        @resetTimer()
+        return if error?
+        debug "Compiled file '#{file.path}'..."
+        @compiled.push file
+        @compileDependentFiles file.path
+    else
       @resetTimer()
-      return if error?
-      debug "Compiled file '#{file.path}'"
-      @compileDependentFiles file.path
 
   copy: (asset) =>
     @copying.push asset


      if @compiling.length is 0 and @copying.length is 0
        @emit 'ready'
      else
        @resetTimer()
    , @RESET_TIME

module.exports = class FileList extends EventEmitter
  # Maximum time between changes of two files that will be considered
  # as a one compilation.
  RESET_TIME: 165

  constructor: (@config) ->
    @files = []
