-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.boot
60 lines (53 loc) · 2.08 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" "env/dev"}
:dependencies '[[ajchemist/boot-figwheel "0.5.4-6" :scope "test"] ;; latest release
[org.clojure/tools.nrepl "0.2.12" :scope "test"]
[com.cemerick/piggieback "0.2.1" :scope "test"]
[figwheel-sidecar "0.5.4-7" :scope "test"]
[react-native-externs "0.0.2-SNAPSHOT" :scope "test"]
[org.clojure/clojure "1.9.0-alpha16"]
[org.clojure/clojurescript "1.9.542"]
[org.clojure/core.async "0.3.442"]
[reagent "0.6.1" :exclusions [cljsjs/react cljsjs/react-dom cljsjs/react-dom-server]]
[re-frame "0.9.3"]])
(require
'[boot-figwheel :refer [figwheel cljs-repl]]
'[cljs.build.api :as b]
'[user :as user]
'[externs :as externs])
(require 'boot.repl)
(swap! boot.repl/*default-middleware*
conj 'cemerick.piggieback/wrap-cljs-repl)
(deftask dev
"boot dev, then input (cljs-repl)"
[]
(user/prepare)
(comp
(figwheel
:build-ids ["main"]
:all-builds [{:id "main"
:source-paths ["src" "env/dev"]
:figwheel true
:compiler {:output-to "not-used.js"
:main "env.expo.main"
:optimizations :none
:output-dir "."}}]
:figwheel-options {:open-file-command "emacsclient"
:validate-config false})
(repl)))
(deftask prod
[]
(externs/-main)
(println "Start to compile clojurescript ...")
(let [start (System/nanoTime)]
(b/build ["src" "env/prod"]
{:output-to "main.js"
:main "env.expo.main"
:output-dir "target/expo"
:static-fns true
:externs ["js/externs.js"]
:parallel-build true
:optimize-constants true
:optimizations :advanced
:closure-defines {"goog.DEBUG" false}})
(println "... done. Elapsed" (/ (- (System/nanoTime) start) 1e9) "seconds")))