cljs-exe is a Boot template to create a Clojurescript application that will compile to a native binary using nexe.
nexe, on which this project is based, lists these reasons:
- Ability to run multiple applications with different node.js runtimes.
- Distributable binaries without needing node / npm.
- Starts faster.
- Lockdown specific application versions, and easily rollback.
- Faster deployments.
I'll second those and add: "In ClojureScript."
You will need
$ brew install boot-clj
$ boot -d boot/new new -S -t cljs-exe -n your_project_name
$ cd your_project_name
$ boot package
This will compile some sample Clojurescript code to Javascript, then compiling the Javascript to a native binary.
This project template gives you a few boot tasks:
build
: runs the Clojurescript compiler with defaults that include: fetching npm dependencies that are listed in thejs-dependencies
var inbuild.boot
, emitting source maps, and no compiler optimizations.dev
: runsbuild
in a watch loop, rerunningbuild
anytime you change a source file.binary
: compiles the current project Javascript into a native binary on your platform.package
: compiles Clojurescript to Javascript withsimple
compiler optimizations and no source maps, then compiles that Javascript to a native binary on your platform.