Skip to content

Commit 5f66a78

Browse files
committed
CLJS-994: print a warning when :externs file paths can't be found.
compiler now throw on missing extern as it will nearly always result in a corrupted build.
1 parent 86b1e9f commit 5f66a78

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/clj/cljs/closure.clj

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,21 @@
199199
load. The :use-only-custom-externs flag may be used to indicate that
200200
the default externs should be excluded."
201201
[{:keys [externs use-only-custom-externs target ups-externs]}]
202-
(let [filter-cp-js (fn [paths]
203-
(for [p paths u (deps/find-js-classpath p)] u))
202+
(let [validate (fn validate [p us]
203+
(if (empty? us)
204+
(throw (IllegalArgumentException.
205+
(str "Extern " p " does not exist")))
206+
us))
207+
filter-cp-js (fn [paths]
208+
(for [p paths
209+
u (validate p
210+
(deps/find-js-classpath p))]
211+
u))
204212
filter-js (fn [paths]
205-
(for [p paths u (deps/find-js-resources p)] u))
213+
(for [p paths
214+
u (validate p
215+
(deps/find-js-resources p))]
216+
u))
206217
add-target (fn [ext]
207218
(cons (io/resource "cljs/externs.js")
208219
(if (= :nodejs target)

0 commit comments

Comments
 (0)