   (apply str (interpose "\n" (map #(add-dep-string opts %) sources))))
 
 (comment
-  (path-relative-to (io/file "out/goog/base.js") {:url (io/resource "cljs/core.js")})
-  (add-dep-string {} {:url (io/resource "cljs/core.js") :requires ["goog.string"] :provides ["cljs.core"]})
-  (deps-file {} [{:url (io/resource "cljs/core.js") :requires ["goog.string"] :provides ["cljs.core"]}])
+  (path-relative-to (io/file "out/goog/base.js") {:url (io/resource "out/cljs/core.js")})
+  (add-dep-string {} {:url (io/resource "out/cljs/core.js") :requires ["goog.string"] :provides ["cljs.core"]})
+  (deps-file {} [{:url (io/resource "out/cljs/core.js") :requires ["goog.string"] :provides ["cljs.core"]}])
   )
 
 (defn output-one-file [{:keys [output-to]} js]
-  (if output-to (spit output-to js) js))
+  (cond (nil? output-to) js
+        (string? output-to) (spit output-to js)
+        :else (println js)))
 
 (defn output-deps-file [opts sources]
   (output-one-file opts (deps-file opts sources)))

           (javascript-file (to-url file) [ns] requires))
         compiled-info)))

(extend-protocol Compilable

  File
  (-compile [this opts]
    (if (.isDirectory this)
      (compile-dir this opts)
      (compile-file this)))
  
  clojure.lang.PersistentList
  (-compile [this opts]

        (doseq [form forms]
          (comp/emit (comp/analyze (empty-env) form)))))))

(defn output-directory [opts]
  (or (:output-dir opts) "out"))

(defn compile-file
  "Compile a single cljs file. If no output-file is specified, returns
  a string of compiled JavaScript. With an output-file option, the
  compiled JavaScript will written to this location and the function
  returns a JavaScriptFile. In either case the return value satisfies
  IJavaScript."
  [^File file {:keys [output-file] :as opts}]
  (if output-file
    (let [out-file (io/file (output-directory opts) output-file)
          ns-info (comp/compile-file file out-file)]
      (javascript-file (to-url (:file ns-info))
                       (:provides ns-info)
                       (:requires ns-info)))
    (compile-form-seq (comp/forms-seq file))))

(defn compile-dir
  "Recursively compile all cljs files under the given source
