-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cljs
54 lines (48 loc) · 1.27 KB
/
build.cljs
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
(require '[cljs.build.api :as b])
(defn build-renderer [opt]
(b/build
(b/inputs "src")
{:main 'app.renderer.core
:output-to "app/renderer.js"
:output-dir "out/"
:optimizations opt
:target :browser})
(println "renderer compiled." "Optimizations: " opt))
(defn build-main [opt]
(b/build
(b/inputs "src")
{:main 'app.main.core
:output-to "app/main.js"
:output-dir "out/"
:optimizations opt
:target :nodejs})
(println "main ns compiled." "Optimizations: " opt))
(defn build [opt]
(build-main opt)
(build-renderer opt))
(defn watch []
(future (b/watch
(b/inputs "src")
{:main 'app.main.core
:target :nodejs
:verbose true
:optimizations :simple
:output-to "app/main.js"
:output-dir "out/"}))
(b/watch
(b/inputs "src")
{:main 'app.renderer.core
:target :browser
:verbose true
:optimizations :simple
:output-to "app/renderer.js"
:output-dir "out/"}))
(defn main [cli-arg]
(let [args cli-arg
command (last args)]
(println "Build Type: " command)
(case command
"release" (build :simple)
"watch" (watch)
(build :none))))
(main *command-line-args*)