Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by
{code:title=mylib.js}
mylib = { abc: 3 }


{code:title=other.js}
other = { def: 17 }


{code:title=co.edn}
{:foreign-libs [{:file "mylib.js"
                 :provides ["my-lib"]
                 :requires ["other-lib"]}
                {:file "other.js"
                 :provides ["other-lib"]}]}


Working, with browser REPL:


$ clj -m cljs.main -co co.edn -r
ClojureScript 1.10.339
cljs.user=> (require 'my-lib)

cljs.user=> js/other
#js {:def 17}


Faling with Node:


$ clj -m cljs.main -co co.edn -re node -r
ClojureScript 1.10.339
cljs.user=> (require 'my-lib)
nil
cljs.user=> js/other
repl:13
throw e__6464__auto__;
^

ReferenceError: other is not defined
...

1 Answer

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJS-2856 (reported by mfikes)
...