Fork me on GitHub
#shadow-cljs
<
2023-07-16
>
hifumi12309:07:01

does shadow allow code splitting when targetting node-script or node-library ?

thheller09:07:03

correct. nowadays :target :esm might also be an option, but ESM in node is sort of full of landmines and footguns so be careful 😉

👍 2
hifumi12310:07:33

TypeError: shadow.esm.esm_import$random_bytes is not a constructor
    at file:///Users/.../Desktop/demo/build/cljs-runtime/macchiato.cookies.js:6:73
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
Guess I am unlucky for now 😄

hifumi12310:07:50

My use-case involved being able to use a router with lazily loaded react components on both server-side and client-side. For now I am going to give that up because I would rather not deal with the landmines…

thheller10:07:12

hehe yep 😛