Skip to content

Commit

Permalink
CLJS-672: source maps + optimizations + :libs breaks building
Browse files Browse the repository at this point in the history
Only copy over files to the output directory if the js file record
contains :source-url information.
  • Loading branch information
swannodette committed Nov 18, 2013
1 parent 44c932a commit 34821a2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/clj/cljs/closure.clj
Expand Up @@ -890,15 +890,18 @@
(if (or (not url)
(= (.getProtocol url) "jar"))
(write-javascript opts js)
;; always copy original sources to the output directory
;; when source maps enabled
(let [out-file (if-let [ns (and (:source-map opts)
(first (:provides js)))]
(io/file (io/file (output-directory opts))
(ana/ns->relpath ns)))]
(when (and out-file
(ana/ns->relpath ns)))
source-url (:source-url js)]
(when (and out-file source-url
(or (not (.exists ^File out-file))
(> (.lastModified (io/file (:source-url js)))
(> (.lastModified (io/file source-url))
(.lastModified out-file))))
(spit out-file (slurp (:source-url js))))
(spit out-file (slurp source-url)))
js))))

(comment
Expand Down

0 comments on commit 34821a2

Please sign in to comment.