Skip to content

Instantly share code, notes, and snippets.

@thedavidmeister
Last active July 29, 2017 15:53
Show Gist options
  • Save thedavidmeister/3ebf8c2f316f188874471dab6d516d50 to your computer and use it in GitHub Desktop.
Save thedavidmeister/3ebf8c2f316f188874471dab6d516d50 to your computer and use it in GitHub Desktop.
basic setup for hoplon project
BOOT_CLOJURE_VERSION=1.9.0-alpha17
(def project 'foo/bar)
(def version "0.1.0-SNAPSHOT")
(set-env!
:source-paths #{"src"}
:resource-paths #{"assets"}
:dependencies
'[; scaffolding...
[org.clojure/clojure "1.9.0-alpha17"]
[org.clojure/clojurescript "1.9.655"]
[hoplon "7.0.2"]
[pandeiro/boot-http "0.8.3"]
[adzerk/boot-reload "0.5.1"]
[adzerk/boot-cljs "2.0.0"]])
(require
'[hoplon.boot-hoplon :refer [hoplon]]
'[pandeiro.boot-http :refer [serve]]
'[adzerk.boot-reload :refer [reload]]
'[adzerk.boot-cljs :refer [cljs]])
(deftask dev
"Build app for local development and compile boot CSS."
[a advanced-compilation? bool "Compile CLJS with advanced compilation"]
(comp
(serve
:port 8000
:dir "target_dev"
:httpkit true)
(hoplon)
(watch)
(speak :theme "woodblock")
(reload)
; This compiles cljs in a way that is fast to compile, easy to debug but
; slow to load the page in the browser and with a big FOUC risk.
(cljs
:optimizations (if advanced-compilation? :advanced :none)
:source-map true)
(target :dir #{"target_dev"})))
; src/pages/index.cljs (Github doesn't allow subdirectories in Gists...)
(ns ^{:hoplon/page "index.html"} pages.index
(:require
[hoplon.core :as h]))
(h/html
(h/body
(h/div "Hello world!")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment