This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-29
Channels
- # announcements (2)
- # babashka (18)
- # beginners (42)
- # calva (56)
- # chlorine-clover (35)
- # clara (9)
- # clj-http (1)
- # clj-kondo (19)
- # cljs-dev (8)
- # clojure (14)
- # clojure-europe (23)
- # clojure-france (7)
- # clojure-norway (6)
- # clojure-uk (3)
- # clojurescript (37)
- # community-development (3)
- # cursive (29)
- # datomic (3)
- # emacs (10)
- # events (2)
- # fulcro (77)
- # hyperfiddle (2)
- # introduce-yourself (4)
- # joker (1)
- # lsp (40)
- # malli (52)
- # meander (7)
- # missionary (16)
- # off-topic (3)
- # pedestal (1)
- # re-frame (5)
- # reitit (38)
- # releases (1)
- # shadow-cljs (4)
- # tools-build (18)
- # tools-deps (1)
- # xtdb (8)
I’m trying to build a clojurescript task as part of an uber
task, but I’m struggling to come up with a solution which feels fully integrated with tools.build
. I was hoping/expecting to use cljs.build.api
in my build script, but I don’t see any concept of a basis
there as is found in clojure.tools.build.api
. So I don’t see a compile-cljs analog to clojure.tools.build.api/compile-clj
which operates on a basis
. Therefore, I don’t see a clear way to specify the needed classpath for the build. Instead, I’ve ended up shelling out to a new process which can get the correct classpath. But, my solution doesn’t feel fully integrated. Am I missing something?
Here is what I’ve got (I’m using Figwheel here, but would be just as happy for a release build using a cljs compiler):
deps.edn
:figwheel-release {:extra-deps {com.bhauman/figwheel-main {:mvn/version "0.2.15"}}
:main-opts ["-m" "figwheel.main"
"--build-once" "release"]
:extra-paths ["client/src" "resources"]}
build.clj
(defn cljs [_]
(b/process {:command-args ["clojure" "-A:figwheel-release"]}))
release.cljs.edn
{:main ___
:output-to "___"
:output-dir "___"
:optimizations :advanced}
@sashton You can create a java process which invokes cljs.main
with args`"-m" "clojure.main" "-m" "cljs.main"`
you are starting a new process either way, compile-clj
is also starting a new clojure process
See https://github.com/clojure/tools.build/blob/f57f3babcff129cf7df7af57c9c462459be1a698/src/main/clojure/clojure/tools/build/tasks/compile_clj.clj#L76-L81. You can do a similar thing for cljs.main
yeah, that’s true. I guess I was interested in an api which already handles error codes, etc. It seems like a little boilerplate to handle it in each build file, rather than via an api call. I guess I’m wondering: if this isn’t already a feature, is it something someone is considering/working on?
I could certainly roll my own compile-cljs
, but I wanted to check if there was already something like that out there
I would be happy to have a contribution towards that
Or maybe it makes sense as a separate lib, not sure
There is not anything I'm aware of