Fork me on GitHub
#shadow-cljs
<
2021-04-24
>
dvingo02:04:09

can you post your shadow-cljs.edn config for this build? you likely have to set :output-dir and asset-path to different values than they are now. For example:

:builds 
{:my-build {:output-dir  "dev/public/js" :asset-path "/js" :modules {...}
  :devtools   {:http-port          8021
                                  :http-resource-root "public"
                                  :http-root          "dev/public/"}}

thheller07:04:57

@huxley you cannot open the html file directly from disk. it needs to be served via http (eg. via :dev-http)

yiorgos21:04:05

what opts do I need to pass in this line? :main-opts ["-m" "shadow.cljs.devtools.cli" ] I fount that line here https://shadow-cljs.github.io/docs/UsersGuide.html#deps-edn

yiorgos21:04:33

can I hardcode the watch app in the deps.edn?

thheller21:04:49

sure, just add "watch" "app"

👍 3
yiorgos21:04:56

something like :main-opts ["-m" "shadow.cljs.devtools.cli" "watch app"]

yiorgos21:04:09

ah, let me try

Janne Sauvala23:04:00

Hello 👋:skin-tone-2: If I have understood correctly shadow-cljs produces some JS code that will open a websocket server (in the client) and adds that to the rest of the JS code generated from CLJS. That websocket server will then accept new code updates (like user’s REPL evals) from the shadow-cljs process (that does the compilation of the CLJS code to JS). Would it be possible to open manually the websocket server inside the library I have created (I guess I can just require shadow-cljs NPM package and use that?) and make it accept JS code coming from the shadow-cljs build process?

Janne Sauvala23:04:18

I’m interested trying out to keep the REPL-feeling when I have done a release build. The release build will strip away this websocket-server since it is made to be used only for dev time.

lilactown01:04:43

the release build won't allow you to interact with any of the built code, even with a REPL, because it's all been minified

thheller07:04:08

well most importantly shadow-cljs is written in Clojure not ClojureScript. so you cannot embed it into a JS process.

thheller07:04:41

but also that part of shadow-cljs is not written as a library and cannot be used like that. it is meant as a standalonee process to do what shadow-cljs does not some other user-related things

Janne Sauvala09:04:00

Thanks for the answers. I’ll go back to the hammock to think about this 🙂