Permalink
Browse files

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.
  • Loading branch information...
1 parent 44c932a commit 34821a2595c194a9acee9b122cd331fbf495a7a8 @swannodette swannodette committed Nov 18, 2013
Showing with 7 additions and 4 deletions.
  1. +7 −4 src/clj/cljs/closure.clj
View
@@ -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

0 comments on commit 34821a2

Please sign in to comment.