Skip to content

Commit 309e209

Browse files
anmonteiroswannodette
authored andcommitted
CLJS-2251: Follow-up fix to CLJS-2249 and related commit
1 parent 8d65bab commit 309e209

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/main/clojure/cljs/build/api.clj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,7 @@
193193
(if-not (nil? env/*compiler*)
194194
env/*compiler*
195195
(env/default-compiler-env
196-
(closure/add-externs-sources
197-
(closure/add-implicit-options opts))))))
196+
(closure/add-externs-sources opts)))))
198197
([source opts compiler-env]
199198
(doseq [[unknown-opt suggested-opt] (util/unknown-opts (set (keys opts)) closure/known-opts)]
200199
(when suggested-opt

src/main/clojure/cljs/closure.clj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2459,6 +2459,9 @@
24592459
#(-> %
24602460
(update-in [:options] merge all-opts)
24612461
(assoc :target (:target opts))
2462+
;; Save the current js-dependency index once we have computed all-opts
2463+
;; or the analyzer won't be able to find upstream dependencies - Antonio
2464+
(assoc :js-dependency-index (deps/js-dependency-index all-opts))
24622465
;; Save list of sources for cljs.analyzer/locate-src - Juho Teperi
24632466
(assoc :sources sources)))
24642467
(binding [comp/*recompiled* (when-not (false? (:recompile-dependents opts))

src/test/clojure/cljs/build_api_tests.clj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
[cljs.env :as env]
1717
[cljs.analyzer :as ana]
1818
[cljs.test-util :as test]
19-
[cljs.build.api :as build]))
19+
[cljs.build.api :as build]
20+
[cljs.closure :as closure]))
2021

2122
(deftest test-target-file-for-cljs-ns
2223
(is (= (.getPath (build/target-file-for-cljs-ns 'example.core-lib nil))
@@ -409,4 +410,7 @@
409410
:target :nodejs}]
410411
(test/delete-out-files out)
411412
(build/build (build/inputs (io/file root "foreign_libs_cljs_2249")) opts)
413+
(is (.exists (io/file out "calculator_global.js")))
414+
(test/delete-out-files out)
415+
(closure/build (build/inputs (io/file root "foreign_libs_cljs_2249")) opts)
412416
(is (.exists (io/file out "calculator_global.js")))))

0 commit comments

Comments
 (0)