This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-06
Channels
- # babashka (101)
- # beginners (47)
- # biff (7)
- # calva (36)
- # clj-kondo (19)
- # clojure (11)
- # clojure-europe (1)
- # clojurescript (4)
- # conjure (4)
- # core-typed (3)
- # cursive (24)
- # emacs (22)
- # events (4)
- # gratitude (1)
- # introduce-yourself (1)
- # malli (27)
- # meander (5)
- # off-topic (101)
- # portal (5)
- # shadow-cljs (26)
- # tools-build (4)
- # tools-deps (3)
- # vim (8)
- # xtdb (13)
How can I trigger compilation by changing a file that is not a sourcefile? (it’s a css file I include for lambdaislands ornament, which is included in the :flush stage triggered by a hook in shadow-cljs.edn)
That css contains color-variables that are included in the file that is built with ornament
ah I guess something like this https://github.com/lambdaisland/ornament#shadow-cljs-build-hook-example?
well yeah, thats a prime example of why I strongly discourage using build hooks for this
you constrain yourself to only being able to generate CSS by running a shadow-cljs build
hmm ok. I guess what you can do is what this macro does https://clojureverse.org/t/using-none-code-resources-in-cljs-builds/3745
https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/resource.clj#L49
in a build hook this would be (assoc-in build-state [:compiler-env :cljs.analyzer/namespaces your.ns :shadow.resource/resource-refs "some/path.css"] last-mod)
I think I solved it (for my use-case) by adding the file to the classpath and using a simple (inline …) in one of the sources