I'm trying to write some code (to run at compilation time) that will only
do a require if a library is present. Initially I thought of trying
something like this:
(defmacro include-if-present []
(when (io/resource "foo/bar.cljc")
'(require 'foo.bar)))
Now I understand that 'require' in cljs is intended as a repl-only thing
which expands to an ns form:
https://clojurescript.org/guides/ns-forms#_the_require_and_require_macros_macros
So, rather than 'cljs.core/require', then perhaps what'd work it to be able
to hook in at the point the ns forms as read initially.
Any ideas please let me know.
Thanks,
Henry
--
Note that posts from new members are moderated - please be patient with your
first post.
---
You received this message because you are subscribed to the Google Groups
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/clojurescript.