         (for [[target path] assets]
           [[path target]
            (cond
-             (.endsWith target ".js")  (minify-js path target opts)
-             (.endsWith target ".css") (minify-css path target opts)
+             (.endsWith target js)  (minify-js path target opts)
+             (.endsWith target css) (minify-css path target opts)
              :else (throw (ex-info "unrecognized target" target)))])))

(defn minify-css-input [source target {:keys [linebreak] :or {linebreak -1}}]
  (with-open [rdr (reader source)
              wrt (writer target)]
    (-> rdr (CssCompressor.) (.compress wrt linebreak))))

(defn minify-css [path target & [opts]]
  (delete-target target)
  (let [assets (aggregate path ".css")
        tmp    (File/createTempFile "temp-sources" ".css")
        target (file target)]
    (with-open [wrt (writer tmp :append true)]
      (doseq [file assets]

                                      optimization :simple}}]]
  (delete-target target)
  (if (= :none optimization)
    (merge-files (aggregate path js) target)
    (do
      (if quiet?
        (com.google.javascript.jscomp.Compiler/setLoggingLevel Level/OFF)
        (com.google.javascript.jscomp.Compiler/setLoggingLevel Level/SEVERE))
      (let [assets   (aggregate path js)
            compiler (com.google.javascript.jscomp.Compiler.)
            result   (compile-js compiler assets externs optimization language)]
        (spit target (.toSource compiler))
