Browse Source

fix: update publishing setup since there are 2 more assets

Also add compilation flag for code splitting bug
Gabriel Horner 2 years ago
parent
commit
a80a182a8f

+ 1 - 1
deps/publishing/src/logseq/publishing/export.cljs

@@ -8,7 +8,7 @@
 
 (def ^:api js-files
   "js files from publishing release build"
-  ["main.js" "code-editor.js" "excalidraw.js" "tldraw.js"])
+  ["shared.js" "main.js" "code-editor.js" "excalidraw.js" "tldraw.js" "db-worker.js"])
 
 (def ^:api static-dirs
   "dirs under static dir to copy over"

+ 1 - 0
deps/publishing/src/logseq/publishing/html.cljs

@@ -122,6 +122,7 @@ necessary db filtering"
         }
       }(window.location))"]
             ;; TODO: should make this configurable
+            [:script {:src "static/js/shared.js"}]
             [:script {:src "static/js/main.js"}]
             [:script {:src "static/js/interact.min.js"}]
             [:script {:src "static/js/highlight.min.js"}]

+ 4 - 1
shadow-cljs.edn

@@ -121,7 +121,10 @@
                                   :externs            ["datascript/externs.js"
                                                        "externs.js"]
                                   :warnings           {:fn-deprecated false
-                                                       :redef false}}
+                                                       :redef false}
+                                  ;; https://github.com/thheller/shadow-cljs/issues/611#issuecomment-620845276
+                                  ;; fixes cljs.spec bug with code splitting
+                                  :cross-chunk-method-motion false}
                :devtools         {:before-load frontend.core/stop
                                   :after-load  frontend.core/start
                                   :preloads    [devtools.preload]}}}}