Hi o/,
I'm having difficult to run my clojurescript app, it seems not able to find my index.html file... What I am trying to do is, generate the js files in public/js and my index.html is at the root of public folder, so when I try to run my script dev.sh to start the repl it always show me the default-index not my index file. (is I move my index.html to the root folder of the project, it works nicely) thinking-face
#!/usr/bin/env bash
clojure -M \
--main cljs.main \
--output-dir public/js \
--output-to public/js/main.js \
--verbose \
--watch src \
--compile todo.main \
--replRunning a full-stack app with a CLJS REPL is something that should only be considered for development.
When index.html is not found, you should see the default HTML page that says how to replace it. Namely:
> To provide your own custom page, place an index.html file in the REPL launch directory
Right, then since I am running the repl in my root directory I will look for index there...
So what I need then is tell the repl where is my :static-dir, im my case public
also tell the compiler to change the :asset-path to js, as it already get public from --output-dir option...
#!/usr/bin/env bash
clojure -M \
--main cljs.main \
--output-dir public/js \
--compile-opts '{:asset-path "js"}' \
--verbose \
--watch src \
--repl-opts '{:static-dir "public"}'\
--compile todo.main \
--replNow I have it working 🥳
And in case you have a separate backend server, I would definitely recommend just serving all the relevant static files with it.