Fork me on GitHub

So in context of the below message, I need to compile my clojurescript and add it's location to resource-paths, so it can be accessed by the webserver I'm running and served to the client. What's the idomatic way to do this in boot?


Usually you need to place the sources in : source-paths and boot-cljs takes care of adding the js to the the served files @donyorm


You might need to add assets to resource-paths though


Yeah I found the asset-paths key after I posted that. I think it does what I want, but I still have yet to get it working.


Yeah static files are not compiled and therefore you add them in there


JS is added for you


@richiardiandrea So what path should I put into my html file. I currently have it looking in /js/main.js and it's not finding anything. /main.js also doesn't exist.


donyorm: in which folder is this?


Sorry this is the html file loaded at localhost:3000/index.html. It's the luminus project I'm converting to boot, if that context helps.


donyorm: so if you add resources/ then the content will be served at localhost:3000/js/index.html...


Unless there is something else going on there


richiardiandrea: Sorry, add resources/ to what?


see above, :resources-paths. What I meant is that what you have in :resources-paths will be served at the root of localhost:3000

Ruben W14:07:06

Hi, I’m trying to setup a boot task that - reloads clientside only when clojurescript changes, - serverside only restart when clojure code changes. The tasks themselves work fine, but right now only changes in clojurescript are picked up. Does anyone know how to accomplish this?

(deftask run-clj-dev []
    (watch :verbose true :include #{#"\.(clj|cljc)$"})
    (system :sys #'dev-system :auto true :files ["api.clj"])
    (repl :server true :port 8009)))

(deftask run-cljs-dev []
    (watch :verbose true :include #{#"\.(cljs|cljc)$"})
    (reload    :ids #{"js/main"})
    (cljs-repl :ids #{"js/main"} :nrepl-opts {:port 9009})
    (cljs      :ids #{"js/main"} :optimizations :none :source-map true)))

(deftask run-dev []


@freakinruben you can’t have two watch tasks in the same pipeline


try boot watch run-clj-dev run-cljs-dev with the watch tasks inside these tasks removed

Ruben W15:07:21

martinklepsch: tnx! that works, but then my clojurescript also gets recompiled when clj files change

Ruben W15:07:18

any workaround for that?


hm. In theory .clj files might affect cljs compilation (bc. macros) so I’m not sure if there’s an easy way to avoid it


@freakinruben the compilation of your cljs should be super quick though given that nothing changed. What kind of compile times are you seeing?

Ruben W15:07:08

my machine is not really fast.. an empty main.cljs is about 1-2 seconds

Ruben W15:07:02

but it makes sense, thanks for clarifying!


my boot installation appears to be broken. No matter what command I try to run, I get the same stack trace, which seems to be lacking critical details, like the path to the file with the error in it:


Any ideas on how to proceed?


deleting /.boot/cache and /.boot/tmp does not help


reinstalling does not help


where is this boot.user file that apparently has a syntax error in it!?


Ah, found it! I had a typo on line 150 of build.boot. It's unfortunate that neither that line number nor that file appeared anywhere in boot's error message.


hm, actually line 150 is mentioned in the stack trace, for -- is that coincidence or a clue?


Coincidence. Oh well.


@chouser boot.user:37 at the bottom there, does that correspond to the error? you can see boot’s idea of your build.boot with boot -b | cat -n


ah, I see. Yes, that would have pointed at the right place.