   (and (satisfies? deps/IJavaScript js)
        (deps/-foreign? js)))
 
-(defn add-implicit-options [opts]
+(defn add-implicit-options
+  [{:keys [optimizations output-dir]
+    :or {optimizations :none
+         output-dir "out"}
+    :as opts}]
   (let [opts (cond-> opts
                (:closure-defines opts)
                (assoc :closure-defines

        env/*compiler*
        (env/default-compiler-env opts))))
  ([source opts compiler-env]
    (let [path (Paths/get (.toURI (io/file source)))
          fs (.getFileSystem path)
          service (.newWatchService fs)]
      (letfn [(buildf []

    (cond->
      (-> opts
        (assoc
          :optimizations optimizations
          :output-dir output-dir
          :ups-libs libs
          :ups-foreign-libs foreign-libs
          :ups-externs externs)
        (update-in [:preamble] #(into (or % []) ["cljs/imul.js"])))

      (:target opts)
      (assoc-in [:closure-defines (str (comp/munge 'cljs.core/*target*))]
        (name (:target opts)))

      (= optimizations :none)
      (assoc
        :cache-analysis (:cache-analysis opts true)
        :source-map (:source-map opts true)))))

(defn build
  "Given a source which can be compiled, produce runnable JavaScript."
