     (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)))
-      (nil? (:optimizations opts))
-      (assoc :optimizations :none))))
+
+      (= 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."

  (and (satisfies? deps/IJavaScript js)
       (deps/-foreign? js)))

(defn add-implicit-options [opts]
  (let [opts (cond-> opts
               (:closure-defines opts)
               (assoc :closure-defines

        env/*compiler*
        (env/default-compiler-env opts))))
  ([source opts compiler-env]
    (let [opts (cond-> opts
                 (= (:verbose opts :not-found) :not-found)
                 (assoc :verbose true))
          path (Paths/get (.toURI (io/file source)))
          fs (.getFileSystem path)
          service (.newWatchService fs)]
      (letfn [(buildf []
