Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watching multiple directories with devtools :watch-dir #1107

Open
Barakat opened this issue Apr 1, 2023 · 3 comments
Open

Watching multiple directories with devtools :watch-dir #1107

Barakat opened this issue Apr 1, 2023 · 3 comments

Comments

@Barakat
Copy link

Barakat commented Apr 1, 2023

I have SCSS files that are compiled to CSS and saved in the target/scssbuild directory. How do I make devtools watch this directory and hot-reload it too?

My shadow-cljs.edn so far is:

:devtools   {:watch-dir "resources/public"
                  ...}

resources/public contains files that are being tracked by git, and I would like to keep auto-generated files out of it.

@Barakat Barakat changed the title Watching multiple directories with devtools :watch-dir Watching multiple directories with devtools :watch-dir Apr 1, 2023
@thheller
Copy link
Owner

thheller commented Apr 1, 2023

How is target/scssbuild accessible via web? :watch-dir only allows one option since it assumes there is only one http root. It doesn't need to watch anything else since it is only loading files from that http root?

I generally have my public dir in git as well, then just exclude public/js and public/css, so where all the generated files go.

@Barakat
Copy link
Author

Barakat commented Apr 1, 2023

target/scssbuild is a resource directory with a public directory inside, similar to target/cljsbuild:

  :resource-paths ["resources" "target/cljsbuild" "target/scssbuild"]

It works, except that the browser has to be manually reloaded each time SCSS files are modified.

@thheller
Copy link
Owner

thheller commented Apr 1, 2023

Only solution I can offer for now is outputting to resources/public/css and gitignoring that. Saves a bunch of config as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants