=>> node out/main.js
/Users/chen/repo/gist/lumo-api/out/main.js:1
(function (exports, require, module, __filename, __dirname) { goog.addDependency("base.js", ['goog'], []);
^
ReferenceError: goog is not defined
at Object.<anonymous> (/Users/chen/repo/gist/lumo-api/out/main.js:1:63)
at Module._compile (module.js:662:30)
at Object.Module._extensions..js (module.js:673:10)
at Module.load (module.js:575:32)
at tryModuleLoad (module.js:515:12)
at Function.Module._load (module.js:507:3)
at Function.Module.runMain (module.js:703:10)
at startup (bootstrap_node.js:193:16)
at bootstrap_node.js:660:3
=>> lumo build.cljs
Assert failed: :nodejs target not compatible with :whitespace optimizations
(not (and (= target :nodejs) (= optimizations :whitespace)))
(Object.lumo$closure$check_node_target)
Function.lumo.closure.build.cljs$core$IFn$_invoke$arity$3 (evalmachine.<anonymous>:4430:14)
Function.lumo.build.api.build.cljs$core$IFn$_invoke$arity$3 (evalmachine.<anonymous>:594:31)
Function.lumo.build.api.build.cljs$core$IFn$_invoke$arity$2 (evalmachine.<anonymous>:524:29)
lumo$build$api$build (evalmachine.<anonymous>:510:29)
(evalmachine.<anonymous>:2:22)
ContextifyScript.Script.runInThisContext (vm.cljs:50:33)
Object.runInThisContext (vm.cljs:152:38)
(Object._t)
(Object.lumo.repl.caching_node_eval)
=>> lumo build.cljs
compiling ClojureScript code with Lumo is not good experience
and the last command just hangs. probably it's because it's slow.
I don't know how to use it...
src/app/main.cljs
(println "Hello world!")
build.cljs
(require 'lumo.build.api)
(lumo.build.api/build "src" {:output-to "out/main.js"
:optimizations :simple
:target :nodejs})
maybe I'm wrong.
I thought I could add an example that beginners can compile ClojureScript code to Node.js and run node out/main.js
in a few steps. Turned out not as simple as I thought.
You can compile it using clojure just as easily. That's what I'm doing and it's working well
@jiyinyiyong the GCC compiler for js is not as fast as the Java one for sure and there are lot of things that might go wrong. I am compiling with JVM at the moment as well