-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.boot
62 lines (51 loc) · 1.7 KB
/
build.boot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
(set-env!
:source-paths #{"src/cljs"}
:resource-paths #{"resources"}
:dependencies '[[adzerk/boot-cljs "2.1.4" :scope "test"]
[adzerk/boot-cljs-repl "0.3.3" :scope "test"]
[adzerk/boot-reload "0.6.0" :scope "test"]
[com.cemerick/piggieback "0.2.1" :scope "test"]
[weasel "0.7.0" :scope "test"]
[org.clojure/tools.nrepl "0.2.12" :scope "test"]
[pandeiro/boot-http "0.8.3" :scope "test"]
[org.clojure/clojure "1.9.0"]
[org.clojure/clojurescript "1.10.339"]
[reagent "0.8.1"]])
(require
'[adzerk.boot-cljs :refer [cljs]]
'[clojure.java.io :as io]
'[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]]
'[adzerk.boot-reload :refer [reload]]
'[pandeiro.boot-http :refer [serve]])
(deftask build []
(comp (speak)
(cljs)))
(deftask run []
(comp (serve :port 8002)
(watch)
(cljs-repl)
(reload)
(build)))
(deftask production []
(task-options! cljs {:optimizations :advanced})
identity)
(deftask development []
(task-options! cljs {:optimizations :none
:source-map true}
reload {:on-jsload 'snake.app/init})
identity)
(deftask generate-index-page [] ; null pointer why?
(->> (slurp "src/cljs/snake/app.cljs")
(spit "resources/src/app.cljs")))
(deftask prod []
(comp (production)
(watch)
;(generate-index-page)
(cljs)
(target :dir #{"docs"})))
(deftask dev
"Simple alias to run application in development mode"
[]
(comp (development)
;(generate-index-page)
(run)))