This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-27
Channels
- # bangalore-clj (1)
- # beginners (11)
- # boot (23)
- # business (2)
- # cider (43)
- # cljs-dev (65)
- # cljsjs (17)
- # cljsrn (4)
- # clojure (144)
- # clojure-austin (4)
- # clojure-berlin (3)
- # clojure-finland (4)
- # clojure-nl (2)
- # clojure-russia (13)
- # clojure-spec (73)
- # clojure-uk (42)
- # clojured (2)
- # clojurescript (166)
- # core-matrix (4)
- # cursive (24)
- # datomic (39)
- # dirac (8)
- # hoplon (97)
- # jobs (2)
- # jobs-rus (11)
- # juxt (16)
- # lein-figwheel (8)
- # leiningen (1)
- # luminus (5)
- # lumo (46)
- # off-topic (1)
- # om (39)
- # onyx (43)
- # overtone (1)
- # pedestal (3)
- # perun (6)
- # play-clj (3)
- # protorepl (14)
- # re-frame (21)
- # reagent (25)
- # remote-jobs (1)
- # ring (1)
- # robots (4)
- # rum (13)
- # specter (5)
- # untangled (72)
- # yada (62)
I have a boot cljs project building both :optimizations :none and :optimiozations :advanced. I want (dirac.runtime/install!) + (devtools.core/install!) + dependencies to ONLY be in the :opt-none build, and NOT in the :opt-advanced build. How can I configure this?
I have a cljs project with with node js as the target. for development, how can I run node
with boot.util/sh
after the project is built, but only once, so that node isn’t started every time a file changes and watch
triggers?
so when do you want to shell out to node?
can you post your pipeline?
@pesterhazy this is my pipeline
(def backend-target "/build/backend")
(deftask backend-dev []
(merge-env! :source-paths ["clj/backend/src"])
(comp
(with-post-wrap fileset
(binding [*sh-dir* backend-target]
(sh "node" "backend"))
fileset)
(watch)
(reload :ids ["backend"] :on-jsload 'backend.core/main :port 7890 :disable-hud true)
(cljs :ids ["backend"])
(target :dir #{backend-target})))
what happens, and what would you prefer to happen?
with this, (sh "node" “backend”))
is never executed. And I would expect it to be executed once after target
has written the fileset the first time to backend-target
yeah that won't work because watch
starts a loop of the following tasks, and it's an infinite loop
what you can do is
to create a task with a delay
which derefs that delay, and add that task at the end of the pipeline
that way, the body of the delay will only be executed once, i.e. after your target dir was written
(deftask run-node [] (let [d (delay (sh "node" ..))] (with-pass-thru [_] @delay)))
@pesterhazy thanks! that worked
do you have boot-reload working with node?
interesting, does it work with websockets, just like in the browser?
cool I should check it out sometime
It would be great if boot-figreload
works with node as well
@pesterhazy I can’t figure out if/how reload would have ever worked for me with nodejs. maybe I’m just confusing with having it working with figwheel. (I just moved the whole project from lein to boot)
I mean with node and lumo I can now just attach using the socket repl, which works ok