This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-17
Channels
- # aws-lambda (1)
- # beginners (55)
- # cider (19)
- # clojure (96)
- # clojure-spec (2)
- # clojure-uk (6)
- # clojurescript (22)
- # datomic (6)
- # editors (13)
- # emacs (6)
- # euroclojure (1)
- # hoplon (3)
- # immutant (1)
- # jobs-rus (2)
- # off-topic (2)
- # onyx (4)
- # portkey (3)
- # re-frame (76)
- # reagent (110)
- # shadow-cljs (13)
- # spacemacs (10)
- # specter (9)
- # tools-deps (9)
- # vim (7)
Hi
I want to compile my clojurescript code into a js library, and use as an external library in another pure JS react application
What do I need to add to my lein
options in order for me to be able to use the cljs
code as a module? (`export` and import
) way
There seems to be ^:export
metadata that you can use on the function. I never done it though.
I don't want to have to do it manually every time I make changes and compile my clojure library
shadow-cljs provides a build target that does a lot of the work for you: https://shadow-cljs.github.io/docs/UsersGuide.html#target-npm-module
it requires switching to using shadow-cljs instead of the standard cljs compile toolchain tho
I don’t understand how it would be more manual than what you would do with a JS library?
I'm trying to use cljs.js/eval, but running into cljs.core
not being loaded. Is there something special needed to bootstrap clojurescript itself into cljs.js/eval?
@dominicm +
should come with (cljs.js/empty-state)
. A small example is on this page https://clojurescript.org/community/reporting-bootstrap-issues