We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
.cljs
.cljc
1 parent ddf1836 commit ce6c657Copy full SHA for ce6c657
src/main/clojure/cljs/js_deps.cljc
@@ -133,7 +133,18 @@ case."
133
(fn [index' provide]
134
(if (:foreign dep)
135
(update-in index' [provide] merge dep)
136
- (assoc index' provide dep)))
+ ;; when building the dependency index, we need to
137
+ ;; avoid overwriting a CLJS dep with a CLJC dep of
138
+ ;; the same namespace - António Monteiro
139
+ (let [file (when-let [f (or (:source-file dep) (:file dep))]
140
+ (.toString f))
141
+ ext (when file
142
+ (.substring file (inc (.lastIndexOf file "."))))]
143
+ (update-in index' [provide]
144
+ (fn [d]
145
+ (if (and (= ext "cljc") (some? d))
146
+ d
147
+ dep))))))
148
index provides)
149
index)]
150
0 commit comments