Fork me on GitHub

So the CSS auto reload is not working for me because I dynamically load the CSS (based on tenant configuration), the setup is similar in development also, and I read in the documentation that any absolute references CSS resources should auto load. I was wondering if there's a way for me to explicitly instruct shadow to watch certain CSS files at certain paths?


Ok, I coded the path in instead of keeping it dynamic, but still I don't see any reloads happening hmm. Double checking things.


As far as I can tell config looks ok 😞


and what does the config look like? 😛


note that in shadow-cljs you don't need separate dev/release builds. one build for both cases is enough.


otherwise looks fine. assuming your CSS files actually reside in resources/public somewhere and that your link tags in the HTML use absolute paths


They do 😞 but I will make sure, for sure I am doing something wrong somewhere. Thanks for your help. The debug/release build are just left-over from figwheel days 🙂


paths need to match, thats about it. so resources/public/whatever/foo.css would be /whatever/foo.css in the HTML


assuming of course you use the server on :3449


this looks somewhat suspicious :devtools-url "". don't know why you are doing that


suggests that you are using another server inbetween that maybe mucks with the paths


in which case you might to tweak the :watch-path "/foo" option (prefix)


yes, there is an nginx proxy sitting in the middle which proxies requests to shadow-cljs and the backend ... that's a good point, I will check what its re-writing this path to. I will also check directly against :3449 .. thanks for the suggestions!


I see that nginx is not doing anything funky with re-writing URLs, but let me check how it works with direct connection to :3449


Ok, it seems to be running through :3449 🎉 .. I am looking into what's up with going through proxy.


I am not sure what I did but it all seems to be working now. The only change I made was that I exposed port 3449 on to the host from my docker container. But its all working now even with dynamically loaded CSS! Phew! This has been bugging me for a while but its working well now! :thumbsup: thanks for all your help and the amazing shadow-cljs!


Ok, here's an observation: I start my dev env and I go to dev.local and the CSS reloading doesn't work. Then I go to dev.local:3449 and although I cannot reach my backend the frontend loads and then if I make a change to my css, it reloads correctly. Then finally, if I go back to dev.local again, the css loading works (with or without /css/style.css).


Ok, so I am consistently able to reproduce this, I am not including /css/style.css in my html but shadow-cljs seems to be picking up my dynamic include. I can work around this as long as I visit :3449 first.


Shouldn’t pretty-print be the default (or at least persistent) when selected in the inspect latest tab?


Or can this be configured somewhere?


Context is the Tap History facilities in the browser


in ~/.shadow-cljs/config.edn :js-options {:preferred-display-type :pprint}