Skip to content

Commit f14b561

Browse files
committed
CLJS-1387: support local Closure libs that conform to classpath
cljs.js-deps/find-classpath-lib didn't add :closure-lib true cljs.closure/lib-rel-path didn't handle nil lib-path
1 parent e2e5525 commit f14b561

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/main/clojure/cljs/closure.clj

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,14 +1186,16 @@
11861186
(- (count (.split #"\r?\n" fdeps-str -1)) 1)
11871187
0)})))))))
11881188

1189-
(defn lib-rel-path [{:keys [lib-path url] :as ijs}]
1190-
(if (.endsWith lib-path ".js")
1191-
(util/get-name url)
1192-
(let [path (util/path url)]
1193-
(string/replace
1194-
path
1195-
(str (io/file (System/getProperty "user.dir") lib-path) File/separator)
1196-
""))))
1189+
(defn lib-rel-path [{:keys [lib-path url provides] :as ijs}]
1190+
(if (nil? lib-path)
1191+
(str (string/replace (first provides) #"\." File/separator) ".js")
1192+
(if (.endsWith lib-path ".js")
1193+
(util/get-name url)
1194+
(let [path (util/path url)]
1195+
(string/replace
1196+
path
1197+
(str (io/file (System/getProperty "user.dir") lib-path) File/separator)
1198+
"")))))
11971199

11981200
(defn ^String rel-output-path
11991201
"Given an IJavaScript which is either in memory, in a jar file,

src/main/clojure/cljs/js_deps.cljc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ JavaScript library containing provide/require 'declarations'."
308308
io/resource)]
309309
(let [{:keys [provides] :as lib-info} (library-graph-node lib-resource)]
310310
(if (some #{(name lib)} provides)
311-
lib-info
311+
(assoc lib-info :closure-lib true)
312312
(binding [*out* *err*]
313313
(println
314314
(format

0 commit comments

Comments
 (0)