   (let [requires (mapcat -requires inputs)
         required-cljs (cljs-dependencies opts requires)
         required (dependencies opts (concat (mapcat -requires required-cljs) requires))]
-    (concat (map #(-> (javascript-file (or (:url %) (io/resource (:file %)))
-                                       (:provides %)
-                                       (:requires %))
-                      (assoc :group (:group %))) required)
-            required-cljs
-            inputs)))
+    (distinct
+     (concat (map #(-> (javascript-file (or (:url %) (io/resource (:file %)))
+                                        (:provides %)
+                                        (:requires %))
+                       (assoc :group (:group %))) required)
+             required-cljs
+             inputs))))
 
 (comment
   ;; add dependencies to literal js

  (let [state (build-index coll)]
    (distinct (:order (reduce comp/dependency-order-visit (assoc state :order []) (keys state))))))

(defn dependencies
  "Given a sequence of Closure namespace strings, return the list of
  all dependencies in dependency order. The returned list includes all

  the value is a list of directories containing third-party
  libraries."
  [opts requires]
  (let [index (js-dependency-index opts)]
    (loop [requires requires
           deps []]
      (if (seq requires)
