                          *cljs-ns* 'cljs.user]
                  (loop [forms (forms-seq src-file)
                         ns-name nil
-                        deps nil]
+                        deps {'cljs.core 'cljs.core}]
                    (if (seq forms)
                      (let [env {:ns (@namespaces *cljs-ns*) :context :statement :locals {}}
                            ast (analyze env (first forms))]
                        (do (emit ast)
                            (if (= (:op ast) :ns)
-                             (recur (rest forms) (:name ast) (:requires ast))
+                             (recur (rest forms) (:name ast) (merge deps (:requires ast)))
                              (recur (rest forms) ns-name deps))))
-                     {:ns (or ns-name 'cljs.user) :requires (vals deps)})))))
+                     {:ns (or ns-name 'cljs.user) :requires (vals deps) :file dest-file})))))
          (throw (java.io.FileNotFoundException. (str "The file " src " does not exist.")))))))
 
 (comment

       (lazy-seq (cons form (forms-seq f rdr)))
       (.close rdr))))

(defn- rename-to-js
  "Change the file extension from .cljs to .js. Takes a File or a
  String. Always returns a String."
  [file-str]

    (compile-file "/tmp/somescript.cljs")
    (slurp "/tmp/somescript.js")))

(defn path-seq
  [file-str]
  (string/split file-str (re-pattern java.io.File/separator)))

