forked from logseq/logseq
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshadow-cljs.edn
More file actions
228 lines (208 loc) · 12.5 KB
/
shadow-cljs.edn
File metadata and controls
228 lines (208 loc) · 12.5 KB
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
;; shadow-cljs configuration
{:deps true
:nrepl {:port 8701}
:source-paths ["src/main" "src/electron" "src/resources"]
;; :ssl {:password "logseq"}
;; "." for /static
:dev-http {3001 ["static" "."]
3002 "static/mobile"}
:js-options {:js-package-dirs ["node_modules"]}
:builds
{:app {:target :browser
:module-loader true
:js-options {:ignore-asset-requires true
:resolve {"react" {:target :global
:global "React"}
"react-dom" {:target :global
:global "ReactDOM"}}}
:modules {:main
{:init-fn frontend.core/init}
:code-editor
{:entries [frontend.extensions.code]
:depends-on #{:main}}}
:output-dir "./static/js"
:asset-path "/static/js"
:compiler-options {:infer-externs :auto
:output-feature-set :es-next-in
:source-map true
:externs ["datascript/externs.js"
"externs.js"]
:warnings {:fn-deprecated false
:redef false}}
:build-hooks [(shadow.hooks/git-revision-hook "--long --always --dirty")]
:closure-defines {lambdaisland.glogi.console/colorize "false"
lambdaisland.glogi.console/timestamp "true"
goog.debug.LOGGING_ENABLED true
frontend.modules.instrumentation.sentry/SENTRY-DSN #shadow/env "LOGSEQ_SENTRY_DSN"
frontend.modules.instrumentation.posthog/POSTHOG-TOKEN #shadow/env "LOGSEQ_POSTHOG_TOKEN"
frontend.config/ENABLE-PLUGINS #shadow/env ["ENABLE_PLUGINS" :as :bool :default true]
;; Set to switch file sync server to dev, set this to false in `yarn watch`
frontend.config/ENABLE-FILE-SYNC-PRODUCTION #shadow/env ["ENABLE_FILE_SYNC_PRODUCTION" :as :bool :default true]
frontend.config/ENABLE-RTC-SYNC-PRODUCTION #shadow/env ["ENABLE_RTC_SYNC_PRODUCTION" :as :bool :default true]
frontend.config/ENABLE-DB-SYNC-LOCAL #shadow/env ["ENABLE_DB_SYNC_LOCAL" :as :bool :default false]
frontend.config/REVISION #shadow/env ["LOGSEQ_REVISION" :default "dev"]} ;; set by git-revision-hook
:devtools {:before-load frontend.core/stop ;; before live-reloading any code call this function
:after-load frontend.core/start ;; after live-reloading finishes call this function
:watch-path "/static"
:preloads [devtools.preload
shadow.remote.runtime.cljs.browser]
:loader-mode :eval
;; :ignore-warnings true
}}
:db-worker {:target :browser
:module-loader true
:js-options {:js-provider :external
:external-index "target/db-worker.js"
:external-index-format :esm
:entry-keys ["module" "browser" "main"]
:export-conditions ["module" "import", "browser" "require" "default"]}
:modules {:db-worker
{:init-fn frontend.worker.db-worker/init
:web-worker true
:prepend-js "importScripts('db-worker-bundle.js');"}}
:output-dir "./static/js"
:asset-path "/static/js"
:release {:asset-path "https://asset.logseq.com/static/js"}
:compiler-options {: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
lambdaisland.glogi.console/colorize "false"
lambdaisland.glogi.console/timestamp "true"}
:devtools {:watch-path "/static"
:preloads [devtools.preload
shadow.remote.runtime.cljs.browser]
:loader-mode :eval}}
:inference-worker {:target :browser
:module-loader true
:js-options {:js-provider :external
:external-index "target/inference-worker.js"
:external-index-format :esm
:entry-keys ["module" "browser" "main"]
:export-conditions ["module" "import", "browser" "require" "default"]}
:modules {:inference-worker
{:init-fn frontend.inference-worker.inference-worker/init
:web-worker true
:prepend-js "importScripts('inference-worker-bundle.js');\n"}}
:output-dir "./static/js"
:asset-path "/static/js"
:release {:asset-path "https://asset.logseq.com/static/js"}
:compiler-options {: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}
:devtools {:watch-path "/static"
:preloads [devtools.preload
shadow.remote.runtime.cljs.browser]}}
:mobile {:target :browser
:module-loader true
:js-options {:ignore-asset-requires true
:resolve {"react" {:target :global
:global "React"}
"react-dom" {:target :global
:global "ReactDOM"}}}
;; handle `require(xxx.css)`
:modules {:main
{:init-fn mobile.core/init}
:code-editor
{:entries [frontend.extensions.code]
:depends-on #{:main}}}
:output-dir "./static/mobile/js"
:asset-path "./js"
:release {:asset-path "http://localhost"}
:compiler-options {:infer-externs :auto
:output-feature-set :es-next-in
:source-map true
:externs ["datascript/externs.js"
"externs.js"]
:warnings {:fn-deprecated false
:redef false}}
:build-hooks [(shadow.hooks/git-revision-hook "--long --always --dirty")]
:closure-defines
{lambdaisland.glogi.console/colorize "false"
lambdaisland.glogi.console/timestamp "true"
goog.debug.LOGGING_ENABLED true
frontend.modules.instrumentation.sentry/SENTRY-DSN #shadow/env "LOGSEQ_SENTRY_DSN"
frontend.modules.instrumentation.posthog/POSTHOG-TOKEN #shadow/env "LOGSEQ_POSTHOG_TOKEN"
;; frontend.config/ENABLE-PLUGINS #shadow/env ["ENABLE_PLUGINS" :as :bool :default true]
;; Set to switch file sync server to dev, set this to false in `yarn watch`
frontend.config/ENABLE-FILE-SYNC-PRODUCTION #shadow/env ["ENABLE_FILE_SYNC_PRODUCTION" :as :bool :default true]
frontend.config/ENABLE-RTC-SYNC-PRODUCTION #shadow/env ["ENABLE_RTC_SYNC_PRODUCTION" :as :bool :default true]
frontend.config/ENABLE-DB-SYNC-LOCAL #shadow/env ["ENABLE_DB_SYNC_LOCAL" :as :bool :default false]
frontend.config/REVISION #shadow/env ["LOGSEQ_REVISION" :default "dev"]}
:devtools {:before-load mobile.core/stop! ;; before live-reloading any code call this function
:after-load mobile.core/render! ;; after live-reloading finishes call this function
:watch-path "/static/mobile"
:preloads [devtools.preload
shadow.remote.runtime.cljs.browser]
:loader-mode :eval}}
:electron {:target :node-script
:output-to "static/electron.js"
:main electron.core/main
:devtools {:before-load electron.core/stop
:after-load electron.core/start}
:compiler-options {:infer-externs :auto
:source-map true
:source-map-include-sources-content true
:source-map-detail-level :all
:externs ["datascript/externs.js"
"externs.js"]
:warnings {:fn-deprecated false
:redef false}}}
:test {:target :node-test
:output-to "static/tests.js"
:closure-defines {frontend.util/NODETEST true
logseq.shui.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}
:test-no-worker {:target :node-test
:output-to "static/tests-no-worker.js"
:closure-defines {frontend.util/NODETEST true
logseq.shui.util/NODETEST true}
:devtools {:enabled false}
:build-options {:ns-exclude-regexp "^(frontend\\.worker|logseq\\.db-sync\\.worker)"}
;; 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
:resolve {"react" {:target :global
:global "React"}
"react-dom" {:target :global
:global "ReactDOM"}}}
:modules {:main
{:init-fn frontend.publishing/init}
:code-editor
{:entries [frontend.extensions.code]
:depends-on #{:main}}}
:output-dir "./static/js/publishing"
:asset-path "static/js"
:closure-defines {logseq.common.config/PUBLISHING true
goog.debug.LOGGING_ENABLED true}
:compiler-options {:infer-externs :auto
:output-feature-set :es-next-in
:source-map true
:externs ["datascript/externs.js"
"externs.js"]
:warnings {:fn-deprecated false
:redef false}}
:devtools {:before-load frontend.core/stop
:after-load frontend.core/start
:preloads [devtools.preload]}}}}