-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.boot
80 lines (69 loc) · 2.65 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
(set-env!
:source-paths #{"src/cljs"}
:resource-paths #{"resources"}
:dependencies '[[adzerk/boot-cljs "2.0.0" :scope "test"]
[adzerk/boot-reload "0.5.2" :scope "test"]
[pandeiro/boot-http "0.8.3" :scope "test"]
[com.cemerick/piggieback "0.2.2" :scope "test"]
[org.clojure/tools.nrepl "0.2.13" :scope "test"]
[weasel "0.7.0" :scope "test"]
[org.clojure/clojurescript "1.9.908"]
[rum "0.10.7"]
[tongue "0.2.2"]
[cljsjs/material-components "0.13.0-0"]
[funcool/potok "2.2.0"]
[funcool/bide "1.4.0"]
[binaryage/devtools "0.9.4" :scope "test"]
[binaryage/dirac "1.2.16" :scope "test"]
[powerlaces/boot-cljs-devtools "0.2.0" :scope "test"]
[laststar/mdc-rum "0.1.0"]])
(require
'[adzerk.boot-cljs :refer [cljs]]
'[adzerk.boot-reload :refer [reload]]
'[pandeiro.boot-http :refer [serve]]
'[powerlaces.boot-cljs-devtools :refer [cljs-devtools dirac]])
(deftask sift-css []
(comp (sift :add-jar {'cljsjs/material-components #".*.css$"})
(sift :move {#".*/material-components.min.inc.css" "css/material-components.min.inc.css"})))
(deftask build
"This task contains all the necessary steps to produce a build
You can use 'profile-tasks' like `production` and `development`
to change parameters (like optimizations level of the cljs compiler)"
[]
(comp (speak)
(sift-css)
(cljs)))
(deftask run
"The `run` task wraps the building of your application in some
useful tools for local development: an http server, a file watcher
and a hot reloading mechanism"
[]
(comp (serve)
(watch)
(cljs-devtools)
(dirac)
(reload)
(build)))
(deftask production []
(task-options! cljs {:optimizations :advanced})
identity)
(deftask development []
(task-options! cljs {:optimizations :none}
reload {:on-jsload 'laststar.app/init})
identity)
(deftask dev
"Simple alias to run application in development mode"
[]
(comp (development)
(run)))
(deftask prod
"Alias to build production in target directory"
[]
(comp (production)
(build)
(sift-css)
(target)))
(deftask serve-prod []
"Serve production build in target directory on port 8080"
(comp (serve :dir "target" :port 8080)
(wait)))