Skip to content

Commit 0c855a1

Browse files
committed
need preserve original :provides
1 parent b258e0f commit 0c855a1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/clojure/cljs/js_deps.cljc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ case."
135135
(some (fn [provide] (get-in index [provide :file]))
136136
(:provides lib-spec))))
137137

138+
(defn lib-spec-merge [a b]
139+
(merge a
140+
(cond-> b
141+
(contains? a :provides) (dissoc :provides))))
142+
138143
(defn build-index
139144
"Index a list of dependencies by namespace and file name. There can
140145
be zero or more namespaces provided per file. Upstream foreign libraies
@@ -148,7 +153,7 @@ case."
148153
(reduce
149154
(fn [index' provide]
150155
(if (:foreign dep)
151-
(update-in index' [provide] merge dep)
156+
(update-in index' [provide] lib-spec-merge dep)
152157
;; when building the dependency index, we need to
153158
;; avoid overwriting a CLJS dep with a CLJC dep of
154159
;; the same namespace - António Monteiro
@@ -165,7 +170,7 @@ case."
165170
index)]
166171
(if (:foreign dep)
167172
(if-let [file (get-file dep index')]
168-
(update-in index' [file] merge dep)
173+
(update-in index' [file] lib-spec-merge dep)
169174
(throw
170175
(Exception.
171176
(str "No :file provided for :foreign-libs spec " (pr-str dep)))))

0 commit comments

Comments
 (0)