mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 22:25:01 +00:00
fix: publishing app in prod mode
Also fix watch-publishing-frontend which had stopped working awhile back with shadow-cljs update
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
|
||||
(def ^:api js-files
|
||||
"js files from publishing release build"
|
||||
(->> ["main.js" "code-editor.js" "excalidraw.js" "tldraw.js" "db-worker.js"]
|
||||
(->> ["main.js" "code-editor.js" "excalidraw.js" "tldraw.js"]
|
||||
;; Add source maps for all js files as it doesn't affect initial load time
|
||||
(mapcat #(vector % (str % ".map")))
|
||||
vec))
|
||||
|
||||
@@ -124,6 +124,7 @@ necessary db filtering"
|
||||
[:script {:src "static/js/react.production.min.js"}]
|
||||
[:script {:src "static/js/react-dom.production.min.js"}]
|
||||
[:script {:src "static/js/ui.js"}]
|
||||
[:script {:src "static/js/main-bundle.js"}]
|
||||
[:script {:src "static/js/main.js"}]
|
||||
;; Deferring scripts above results in errors
|
||||
[:script {:defer true :src "static/js/interact.min.js"}]
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
(defn watch-publishing-frontend
|
||||
[& _args]
|
||||
(shell "clojure -M:cljs watch publishing"))
|
||||
(shell "npx shadow-cljs watch publishing"))
|
||||
|
||||
(defn watch-publishing-backend
|
||||
"Builds publishing backend once watch-publishing-frontend has built initial frontend"
|
||||
|
||||
@@ -187,17 +187,18 @@
|
||||
|
||||
:publishing {:target :browser
|
||||
:module-loader true
|
||||
:js-options {;; handle `require(xxx.css)`
|
||||
:js-options {:js-provider :external
|
||||
:external-index "target/main.js"
|
||||
:external-index-format :esm
|
||||
:entry-keys ["module" "browser" "main"]
|
||||
:export-conditions ["module" "import", "browser" "require" "default"]
|
||||
:ignore-asset-requires true
|
||||
:resolve {"react" {:target :global
|
||||
:global "React"}
|
||||
"react-dom" {:target :global
|
||||
:global "ReactDOM"}}}
|
||||
:modules {:shared
|
||||
{:entries []}
|
||||
:main
|
||||
{:init-fn frontend.publishing/init
|
||||
:depends-on #{:shared}}
|
||||
:modules {:main
|
||||
{:init-fn frontend.publishing/init}
|
||||
:code-editor
|
||||
{:entries [frontend.extensions.code]
|
||||
:depends-on #{:main}}
|
||||
|
||||
Reference in New Issue
Block a user