Monday, 15 September 2014

clojure - leiningen - clojurescript equivalent of lein run? -



clojure - leiningen - clojurescript equivalent of lein run? -

in clojure can run:

lein run -m my.namespace # run -main function of namespace

and run code command line.

is there equivalent clojurescipt run generated code in node.js? (in leiningen)

(i have read doco starting clojurescript repl, running on node.js , reply integrated application. looking one-line command line solution.)

depending on goal is, might find useful utilize 'cljsbuild test'. can specify test context on project.clj uses node.js/v8/phantomjs.

example:

:cljsbuild { :test-commands { "v8" ["v8" "target/generated-sources/private/js/client.js" "tests/v8-test-runner.js"]}}

v8-test-runner.js:

path.to.your.entrypoint.start()

you can leave 'lein cljsbuild auto' running , start javascript application directly:

v8 target/generated-sources/private/js/client.js tests/v8-test-wrapper.js

that's best alternative if building node.js application using clojurescript. don't need worry classpaths in javascript (which major thing lein run provides), can run application straight assembled javascript file.

clojure leiningen clojurescript

No comments:

Post a Comment