This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-31
Channels
- # bangalore-clj (3)
- # beginners (15)
- # boot (128)
- # cider (4)
- # cljs-dev (12)
- # cljsjs (1)
- # clojure (105)
- # clojure-austin (5)
- # clojure-canada (6)
- # clojure-italy (5)
- # clojure-russia (14)
- # clojure-spec (70)
- # clojure-uk (21)
- # clojurebridge (3)
- # clojurescript (264)
- # cloverage (6)
- # cursive (4)
- # data-science (6)
- # datomic (10)
- # dirac (5)
- # editors (30)
- # events (3)
- # hoplon (9)
- # klipse (7)
- # leiningen (3)
- # luminus (4)
- # off-topic (9)
- # om (5)
- # om-next (1)
- # onyx (1)
- # parinfer (2)
- # perun (28)
- # re-frame (5)
- # ring (1)
- # rum (11)
- # spacemacs (2)
- # specter (10)
- # sql (3)
- # uncomplicate (4)
- # untangled (67)
- # vim (2)
- # yada (1)
Alright, next stumbling block: css reloading. My setup that’s still very similar to the getting started wiki… here’s the task I’m running:
(deftask dev
[]
(comp (serve :resource-root "public/")
(watch :verbose true)
(markdown)
(render :renderer 'nicerthantriton.core/dev-page)
(reload)
(cljs)))
I have a css file at public/css/ntt.css
in my resource folder. Since I’m serving out of public/
, my markup refers to css/ntt.css
, but when I modify the file, boot-reload tries to load public/css/ntt.css
and 404’s. I’ve figured out how to prepend a value to the asset path, but can’t seem to figure out how to tell boot-reload to leave the “public/” off the url it tries to reload. Any tips?@bhagany: pass :asset-path "public/"
to the reload task
Did cljs reloading work properly without that? I think it should run into the same issue
@martinklepsch I had tried that, but couldn’t tell what effect it had. I just tried it again, and still no effect.
I don’t have any cljs of my own in this project yet, so css is the first non-html reloading I’ve tried.
oddly, even setting :asset-path “foo/”
still results in a 404 to something like
on reload
Odd indeed, sure you're passing it to the reload task? Maybe paste relevant parts of your build.boot
(set-env!
:source-paths #{"src" "content"}
:resource-paths #{"resources"}
:dependencies '[[pandeiro/boot-http "0.7.0"]
[adzerk/boot-cljs "1.7.228-2" :scope "test"]
[adzerk/boot-reload "0.4.12" :scope "test"]
[hiccup "1.0.5"]
[perun "0.3.0" :scope "test"]])
(require '[adzerk.boot-cljs :refer [cljs]]
'[pandeiro.boot-http :refer [serve]]
'[adzerk.boot-reload :refer [reload]]
'[io.perun :refer :all])
(deftask dev
[]
(comp (serve :resource-root "public/")
(watch :verbose true)
(markdown)
(render :renderer 'nicerthantriton.core/dev-page)
(reload :asset-path "foo/")
(cljs)))
Ok so actually not odd, what asset path does is it strips something from the beginning of paths so foo/ does not have any effect
Are you getting this error when a reload is initiated or on initial load?
You may also need to pass something like asset-path to the compiler via cljs.edn
Can't look up a snippet right now but I suggest you ask in #boot more people there
I'll look something up once I'm on my computer
Ok cool
Np, talk later
@bhagany so after re-reading I'd suggest :asset-path "/public"
(try with leading slash maybe that's our mistake)
It might to a ^
anchored replace so I'm optimistic that this will be the solution 🙂
Maybe we should warn if the string does not start with /