Fork me on GitHub
#tools-deps
<
2021-12-07
>
eelke09:12:09

Hello, I am having trouble building an uberjar with clojure.tools.build.api. Do you have an example of a build that includes ClojureScript, js, and css?

eelke09:12:56

My build file looks like:

eelke09:12:30

I compile all the clj, js into the target folder. Then the jar does seem to contain all the necessary files, but I just do not see the files being loaded into the browser when running the jar

eelke09:12:44

Any ideas?

borkdude10:12:23

In which phase are you running the CLJS build?

borkdude10:12:36

If you do that prior, then clean will wipe out all of those compiled files again

eelke11:12:57

that is not the issue since I can see all the compiled files in de jar. The clean happens before running the cljs build

eelke11:12:36

it is probably something simple I am missing

eelke11:12:34

I also cannot find a single example of using this method of creating an uberjar that combines Clojure and ClojureScript

borkdude11:12:53

So you want to put the uncompiled ClojureScript files into the uberjar?

borkdude11:12:01

How does that help you with a browser ?

borkdude11:12:29

I do not see where you are doing the CLJS build

eelke11:12:51

ok, I will provide you full details at a later moment.

Rachel Westmacott12:12:36

Does anyone know if it's possible in project A to reference a local project B as a local dependency of A while targeting an alias in the local project B?

borkdude12:12:08

not possible

Rachel Westmacott13:12:58

nice to have that confirmed - I couldn't see a way. Thank you!

👍 1
dominicm22:12:34

Not sure if there's anything to learn here, but I ended up adding :paths ["."] to my :build alias so I could do -M:build and start a REPL.

Alex Miller (Clojure team)22:12:14

yeah, this is a known problem that has been nagging at me. eventually I will get around to tackling it seriously

👍 1
seancorfield23:12:27

Our "solution" to that is:

$ clj -M:build -i build.clj -r

seancorfield23:12:43

(for a REPL that is specifically for running build tasks -- which is how I normally run them -- but I also have :build on my primary development REPL command so I can develop and test build.clj inside my editor -- using the editor's "load file" on build.clj to get it loaded into the REPL)

seancorfield23:12:03

My development REPL is started via:

SOCKET_REPL_PORT=5000 clojure -J-Dlog4j2.configurationFile=log4j2-sean.properties -M:rebel:classes:reflect:jedi-time:portal:everything:dev:test:runner:build:dev/repl