Skip to content

Commit

Permalink
CLJS-994: print a warning when :externs file paths can't be found.
Browse files Browse the repository at this point in the history
compiler now throw on missing extern as it will nearly always result
in a corrupted build.
  • Loading branch information
swannodette committed Mar 13, 2015
1 parent 86b1e9f commit 5f66a78
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/clj/cljs/closure.clj
Expand Up @@ -199,10 +199,21 @@
load. The :use-only-custom-externs flag may be used to indicate that
the default externs should be excluded."
[{:keys [externs use-only-custom-externs target ups-externs]}]
(let [filter-cp-js (fn [paths]
(for [p paths u (deps/find-js-classpath p)] u))
(let [validate (fn validate [p us]
(if (empty? us)
(throw (IllegalArgumentException.
(str "Extern " p " does not exist")))
us))
filter-cp-js (fn [paths]
(for [p paths
u (validate p
(deps/find-js-classpath p))]
u))
filter-js (fn [paths]
(for [p paths u (deps/find-js-resources p)] u))
(for [p paths
u (validate p
(deps/find-js-resources p))]
u))
add-target (fn [ext]
(cons (io/resource "cljs/externs.js")
(if (= :nodejs target)
Expand Down

0 comments on commit 5f66a78

Please sign in to comment.