This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-26
Channels
- # beginners (91)
- # cider (34)
- # cljsrn (6)
- # clojure (95)
- # clojure-gamedev (4)
- # clojure-serbia (7)
- # clojure-spec (5)
- # clojure-uk (27)
- # clojurescript (42)
- # data-science (1)
- # datascript (2)
- # datomic (4)
- # duct (10)
- # emacs (11)
- # fulcro (21)
- # luminus (3)
- # lumo (24)
- # off-topic (2)
- # other-languages (2)
- # ring (2)
- # shadow-cljs (39)
- # spacemacs (9)
- # tools-deps (2)
it’s been a while since I used lumo. Say I have foo/build.cljs and foo/src/foo.cljs build.cljs:
(require 'lumo.build.api)
(lumo.build.api/build "src" {:output-to "out/main.js"})
foo.cljs:
(ns foo)
(defn main []
(println (+ 1 2 3)))
I run
lumo -c src build.cljs
Now how I do run the project?
out/main.js
gives an error.@borkdude have you tried node out/main.js
?
You can also run lumo -c src foo
directly
Actually I think the last works only if you set (set! *main-cli-fn*
``-main)`
Sorry on mobile now but there is a back quote there
@borkdude specify :target :nodejs
you’re compiling for the browser
maybe I should have a package.json? is there an example lumo project that uses the build api?
@borkdude random shot in the dark, maybe you need to cd into out
One thing I did in a project was to create a unique JS file with browserify: https://github.com/paullucas/les-clj/blob/master/scripts/build
@borkdude that’s weird. Let’s get you up & running, are you using 1.9.0-alpha?
is there some example project/template which uses the build api? then I can use that to get going
@borkdude no there is no template yet but I think you are compiling correctly. It is just a matter of launching node with the right path
I have been meaning to produce a template but haven't had the time yet
Is it working with lumo
and the cljs namespace directly?
node out/main.js
should work
oh I know what else is wrong
@borkdude this will give an error in 1.9.0-alpha, but :target :nodejs
needs a :main
entry in the compilation options
As strange as it sounds, I have never launched a script directly with node
Oh I thought that would trigger a warning
@richiardiandrea it does, in 1.9.0-alpha. He’s using 1.8.0
Oh right that's true