-
Notifications
You must be signed in to change notification settings - Fork 0
/
shadow-cljs.edn
144 lines (131 loc) · 6.33 KB
/
shadow-cljs.edn
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
{:deps true
:nrepl {:port 8702}
;; "." for /static
:dev-http {3002 ["public" "."]}
:js-options {:js-package-dirs ["node_modules"]}
:builds
{
;; <- just for getting a stable connection for repling, optional
:repl
{:target :browser
:output-dir "public/js"
:modules {:repl {:entries [hashgraph.app.core]
:web-worker true}}}
;; you need to release it, before :app build is usable
:sw
{:target :browser
:output-dir "public/js"
:modules {:sw {:entries [cljs-thread.sw]
:web-worker true}}}
:app
{:target :browser
:output-dir "public/js" ; <- necessary because sw.js must be in root, but output-dir doesn't work per module
:compiler-options {:optimizations :advanced
:infer-externs :auto
:output-feature-set :es-next-in
:source-map true
:warnings {:fn-deprecated false
:redef false
:invalid-arithmetic false
:undeclared-var false}
:reader-features #{:dev}}
;;:dev {:compiler-options {:reader-features #{:dev}}}
:release {:compiler-options {:reader-features #{:release}}}
:closure-defines {goog.debug.LOGGING_ENABLED false}
:build-hooks [(portal.shadow.remote/hook)]
:devtools {:before-load hashgraph.app.screen/stop ;; before live-reloading any code call this function
:after-load hashgraph.app.screen/start ;; after live-reloading finishes call this function
:watch-path "/public"
:preloads [shadow.remote.runtime.cljs.browser
portal.shadow.preload]}
:modules {:shared {:entries []}
:screen {:init-fn hashgraph.app.screen/init
:depends-on #{:shared}}
:core {:init-fn hashgraph.app.core/init
:depends-on #{:shared}
:web-worker true}}}
}
#_#_
:builds
{:app {:target :browser
:module-loader true
:js-options {:ignore-asset-requires true} ;; handle `require(xxx.css)`
:modules {:main {:init-fn hashgraph.app.core/init}}
:output-dir "./public/js"
:asset-path "/public/js"
:release {:asset-path "https://asset.logseq.com/static/js"}
:compiler-options {:optimizations :advanced
:infer-externs :auto
:output-feature-set :es-next-in
:source-map true
:externs ["datascript/externs.js"
"externs.js"]
:warnings {:fn-deprecated false
:redef false}}
:closure-defines {goog.debug.LOGGING_ENABLED true}
;; NOTE: electron, browser/mobile-app use different asset-paths.
;; For browser/mobile-app devs, assets are located in /static/js(via HTTP root).
;; For electron devs, assets are located in ./js(via relative path).
;; :dev {:asset-path "./js"}
:build-hooks [(portal.shadow.remote/hook)]
:devtools {:before-load hashgraph.app.core/stop ;; before live-reloading any code call this function
:after-load hashgraph.app.core/start ;; after live-reloading finishes call this function
:watch-path "/static"
:preloads [shadow.remote.runtime.cljs.browser
portal.shadow.preload]}}
:repl ; <- just for getting a stable connection for repling, optional
{:target :browser
:output-dir "./public/js"
:asset-path "./public/js"
:modules {:repl {:entries [hashgraph.app.core]
:web-worker true}}}
:sw
{:target :browser
:output-dir "./public/js"
:modules {:sw {:entries [hashgraph.app.core]
:web-worker true}}}
;; :core
;; {:target :browser
;; :output-dir "./public/js"
;; :modules
;; {:shared {:entries []}
;; :screen
;; {:init-fn hashgraph.app.screen/init!
;; :depends-on #{:shared}}
;; :core
;; {:init-fn hashgraph.app.core/init!
;; :depends-on #{:shared}
;; :web-worker true}}}
}
#_#_
:test {:target :node-test
:output-to "static/tests.js"
:closure-defines {frontend.util/NODETEST true}
:devtools {:enabled false}
;; disable :static-fns to allow for with-redefs and repl development
:compiler-options {:static-fns false}
:main frontend.test.frontend-node-test-runner/main}
#_#_
:gen-malli-kondo-config {:target :node-script
:closure-defines {frontend.util/NODETEST true}
:devtools {:enabled false}
:compiler-options {:static-fns false}
:output-to "static/gen-malli-kondo-config.js"
:main gen-malli-kondo-config.core/main}
;; :publishing {:target :browser
;; :module-loader true
;; :js-options {:ignore-asset-requires true}
;; :modules {:main
;; {:init-fn frontend.publishing/init}}
;; :output-dir "./public/js/publishing"
;; :asset-path "/public/js"
;; :closure-defines {}
;; :compiler-options {:infer-externs :auto
;; :output-feature-set :es-next
;; :warnings {:fn-deprecated false
;; :redef false}}
;; :devtools {:before-load hashgraph.app.core/stop
;; :after-load hashgraph.app.core/start
;; :preloads [devtools.preload
;; portal.shadow.preload]}}
}