Browse Source

fix: publishing not loading correctly

Caused by pulling in the new component system. Fixes #10893
Gabriel Horner 1 year ago
parent
commit
ce2341506d
2 changed files with 10 additions and 1 deletions
  1. 3 0
      deps/publishing/src/logseq/publishing/html.cljs
  2. 7 1
      shadow-cljs.edn

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

@@ -121,6 +121,9 @@ necessary db filtering"
         }
       }(window.location))"]
             ;; TODO: should make this configurable
+            [: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.js"}]
             [:script {:src "static/js/interact.min.js"}]
             [:script {:src "static/js/highlight.min.js"}]

+ 7 - 1
shadow-cljs.edn

@@ -90,7 +90,13 @@
 
   :publishing {:target :browser
                :module-loader true
-               :js-options {:ignore-asset-requires true}
+               :js-options {;; handle `require(xxx.css)`
+                            :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