Skip to content

Commit b638303

Browse files
committed
wip (do not use)
1 parent 06d81bc commit b638303

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

src/main/clojure/cljs/compiler.cljc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,10 @@
10981098
#?@(:clj
10991099
[(ana/foreign-dep? lib)
11001100
;; we only load foreign libraries under optimizations :none
1101-
(when (= :none optimizations)
1101+
;; under :modules we also elide loads, as the module loader will
1102+
;; have handled it - David
1103+
(when (and (= :none optimizations)
1104+
(not (contains? options :modules)))
11021105
(if (= :nodejs target)
11031106
;; under node.js we load foreign libs globally
11041107
(let [ijs (get js-dependency-index (name lib))]

src/test/cljs_build/loader_test/foo.cljs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
(ns loader-test.foo
22
(:require [goog.dom :as gdom]
33
[goog.events :as events]
4-
[cljs.loader :as loader])
4+
[cljs.loader :as loader]
5+
[my.foreign])
56
(:import [goog.events EventType]))
67

78
(enable-console-print!)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
var foreign = function() {
2+
console.log("I'm foreign!")
3+
};

src/test/clojure/cljs/build_api_tests.clj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@
186186
{:output-dir output-dir
187187
:optimizations :none
188188
:verbose true
189+
:foreign-libs [{:file "loader_test/foreign.js"
190+
:provides ["my.foreign"]}]
189191
:modules
190192
{:foo
191193
{:output-to (str (io/file output-dir "foo.js"))

0 commit comments

Comments
 (0)