vouch-opensource / krell

Simple ClojureScript React Native Tooling
Eclipse Public License 1.0
673 stars 37 forks source link

How to use JavaScript together? #146

Open PlumpMath opened 2 years ago

PlumpMath commented 2 years ago

Hi, I just want to mix it up. Where do you put the files, and what settings do you need? Is it the same as the regular clojure deps.edn cli? ;; I don't know what to do. Thanks.

ttchuong commented 2 years ago

Unlike shadow-cljs, krell seems not support :require arbitrary js files. However, krell is able to js/require those js very well. Let say I follow the tutorial and compile the output into a target folder. Then, I have js/hello.js and want to consume it. The below line of code will work.

(def hello (js/require "../js/hello.js"))

(Note that js and target are at the same level of folder) I can verify the output js by visiting target/krell_npm_deps.js as well. The hello.js should be required there.