File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 193
193
(if-not (nil? env/*compiler*)
194
194
env/*compiler*
195
195
(env/default-compiler-env
196
- (closure/add-externs-sources opts)))))
196
+ ; ; need to dissoc :foreign-libs since we won't know what overriding
197
+ ; ; foreign libspecs are referring to until after add-implicit-options
198
+ ; ; - David
199
+ (closure/add-externs-sources (dissoc opts :foreign-libs ))))))
197
200
([source opts compiler-env]
198
201
(doseq [[unknown-opt suggested-opt] (util/unknown-opts (set (keys opts)) closure/known-opts)]
199
202
(when suggested-opt
Original file line number Diff line number Diff line change 2432
2432
(if-not (nil? env/*compiler*)
2433
2433
env/*compiler*
2434
2434
(env/default-compiler-env
2435
- (add-externs-sources opts)))))
2435
+ ; ; need to dissoc :foreign-libs since we won't know what overriding
2436
+ ; ; foreign libspecs are referring to until after add-implicit-options
2437
+ ; ; - David
2438
+ (add-externs-sources (dissoc opts :foreign-libs ))))))
2436
2439
([source opts compiler-env]
2437
2440
(env/with-compiler-env compiler-env
2438
2441
; ; we want to warn about NPM dep conflicts before installing the modules
Original file line number Diff line number Diff line change @@ -130,6 +130,11 @@ case."
130
130
(-requires [this] " A list of namespaces that this JavaScript requires." )
131
131
(-source [this] [this opts] " The JavaScript source string." ))
132
132
133
+ (defn get-file [libspec index]
134
+ (or (:file libspec)
135
+ (some (fn [provide] (get-in index [provide :file ]))
136
+ (:provides libspec))))
137
+
133
138
(defn build-index
134
139
" Index a list of dependencies by namespace and file name. There can
135
140
be zero or more namespaces provided per file. Upstream foreign libraies
@@ -159,7 +164,11 @@ case."
159
164
index provides)
160
165
index)]
161
166
(if (:foreign dep)
162
- (update-in index' [(:file dep)] merge dep)
167
+ (if-let [file (get-file dep index)]
168
+ (update-in index' [file] merge dep)
169
+ (throw
170
+ (Exception.
171
+ (str " No :file provided for foreign libspec " (pr-str dep)))))
163
172
(assoc index' (:file dep) dep))))
164
173
{} deps))
165
174
You can’t perform that action at this time.
0 commit comments