 
 (defn optimize-modules
   "Use the Closure Compiler to optimize one or more Closure JSModules. Returns
-   a modules map containing :foreign-deps, a dependency sorted list of foreign
-   dependencies, and :modules a dependency sorted list of module name and
-   description tuples."
+   a dependency sorted list of module name and description tuples."
   [opts & sources]
   {:pre [(and (contains? opts :modules)
               (not (contains? opts :output-to)))]}

    (assert (or (nil? (:source-map opts)) source-map)
      "Could not create source maps for modules")
    (if (.success result)
      {:foreign-deps foreign-deps
       :modules
       (vec
         (for [[name {:keys [output-to closure-module] :as module}] modules]
           [name
            (merge
              (assoc module
                :source
                (do
                  (when source-map (.reset source-map))
                  (.toSource closure-compiler ^JSModule closure-module)))
              (when source-map
                (let [sw (StringWriter.)
                      source-map-name (str output-to ".map.closure")]
                  (.appendTo source-map sw source-map-name)
                  {:source-map-json (.toString sw)
                   :source-map-name source-map-name})))]))}
      (report-failure result))))

(defn optimize

        (.add ^JSModule cljs-base-closure-module
          (js-source-file (javascript-name source) source))
        (swap! foreign-deps conj source)))
    (assoc-in modules [0 1 :foreign-deps] @foreign-deps)))

(comment
  (build "samples/hello/src"
