1
0
Эх сурвалжийг харах

fix: publishing not loading correctly

Caused by pulling in the new component system. Fixes #10893
Gabriel Horner 1 жил өмнө
parent
commit
ce2341506d

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

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

+ 7 - 1
shadow-cljs.edn

@@ -90,7 +90,13 @@
 
 
   :publishing {:target :browser
   :publishing {:target :browser
                :module-loader true
                :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
                :modules {:main
                          {:init-fn frontend.publishing/init}
                          {:init-fn frontend.publishing/init}
                          :code-editor
                          :code-editor