 
   state) 
 
-(defn closure-optimize [{:keys [build-modules] :as state}]
+(defn closure-optimize
+  "takes the current defined modules and runs it through the closure optimizer
+
+   will return the state with :optimized a list of module which now have a js-source and optionally source maps
+   nothing is written to disk, use flush-optimized to write"
+  [{:keys [build-modules] :as state}]
   (when-not (seq build-modules)
     (throw (ex-info "optimize before compile?" {})))
 

                "[" (ns-list-string requires) "]);")))
       (str/join "\n")))

(defn flush-unoptimized [{:keys [build-modules public-dir public-path] :as state}]
  (when-not (seq build-modules)
    (throw (ex-info "flush before compile?" {})))
  (println "Flushing unoptimized modules")

                                          )))))))))))


(defn- ns-list-string [coll]
  (->> coll
       (map #(str "'" (comp/munge %) "'"))
