Skip to content

Commit 34821a2

Browse files
committed
CLJS-672: source maps + optimizations + :libs breaks building
Only copy over files to the output directory if the js file record contains :source-url information.
1 parent 44c932a commit 34821a2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/clj/cljs/closure.clj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -890,15 +890,18 @@
890890
(if (or (not url)
891891
(= (.getProtocol url) "jar"))
892892
(write-javascript opts js)
893+
;; always copy original sources to the output directory
894+
;; when source maps enabled
893895
(let [out-file (if-let [ns (and (:source-map opts)
894896
(first (:provides js)))]
895897
(io/file (io/file (output-directory opts))
896-
(ana/ns->relpath ns)))]
897-
(when (and out-file
898+
(ana/ns->relpath ns)))
899+
source-url (:source-url js)]
900+
(when (and out-file source-url
898901
(or (not (.exists ^File out-file))
899-
(> (.lastModified (io/file (:source-url js)))
902+
(> (.lastModified (io/file source-url))
900903
(.lastModified out-file))))
901-
(spit out-file (slurp (:source-url js))))
904+
(spit out-file (slurp source-url)))
902905
js))))
903906

904907
(comment

0 commit comments

Comments
 (0)