Fork me on GitHub
#shadow-cljs
<
2023-12-12
>
pez11:12:27

How do I require a JS file from a known place in node_modules? I need to require node_modules/three/examples/jsm/utils/BufferGeometryUtils.js, but all ways I try fail.

pez11:12:54

Now I tried something that works:

["three/examples/jsm/utils/BufferGeometryUtils.js" :as BufferGeometryUtils]

elken11:12:35

Was just gonna ask if you tried that 😄 :refer also works if you only need a couple of functions from it eg

["react-router-dom" :refer [createBrowserRouter RouterProvider Outlet]]
["@tanstack/react-query" :refer [QueryClient QueryClientProvider]]
["@tanstack/react-query-devtools" :refer [ReactQueryDevtools]]

pez12:12:56

That’s where I started. 😃

🙌 1
Nundrum20:12:06

After building my project in release mode, which files need to be distributed with it? Just js/compiled/app.js or the entire cljs-runtime as well?

thheller21:12:35

cljs-runtime is dev only, so only the app.js

Nundrum21:12:19

Beautiful. Thank you!