     (filter-descendants dir pred))
   Compilable
   (-compile [this opts]
-    (let [fs (files this)]
-      (let [d (io/file dir)]
-        (flatten (map #(-compile % (assoc opts :output-file (js-file-name d %)))
-                      fs))))))
+    (dependency-order
+     (let [fs (files this)]
+       (let [d (io/file dir)]
+         (flatten (map #(-compile % (assoc opts :output-file (js-file-name d %)))
+                       fs)))))))
 
 ;; Provided IReloadable Implementations
 ;; ====================================

    (all-descendants-ending-with dirs ".cljs"))
  Compilable
  (-compile [_ opts]
    (flatten (map #(-compile % opts) dirs))))

(defn rename-to-js
  "Rename any Clojure-based file to a JavaScript file."


  Reloading/Compilation or shared Clojure and ClojureScript files is
  also supported."
  (:use [cljs.closure :only (build -compile dependency-order Compilable)]
        [cljs.compiler :only (to-target-file)])
  (:require [clojure.java.io :as io]))

