A Leiningen template for ClojureScript + dmohs/react-cljs.
Includes figwheel, devtools, and devcards for a great development experience.
Install Leiningen (or use docker as shown below). Then, create a new project from this template:
lein new dmohs.cljs-react myself/my-project --to-dir my-project
cd my-project
Copy index.html into target:
lein resource
Serve the files:
ruby -run -ehttpd target -p8000
(possibly in another shell) Start Figwheel with the Devcards UI:
lein with-profile +devcards figwheel
Once compiling has finished, you should be able to see the Devcards UI here:
Note: Do a clean before rebuilding in a different mode or things may break.
Run your application (without Devcards) with Figwheel's hot reloading:
lein with-profile +figwheel do clean, resource, figwheel
Create a deployable build:
lein with-profile deploy do clean, resource, cljsbuild once
Instead of installing Leiningen, you can just use the Clojure docker image:
docker pull clojure
then:
docker run --rm -it -w /work -v "$PWD":/work -v "$HOME"/.m2:/root/.m2 -p 3449:3449 \
clojure lein figwheel