SebastianStehle / yjs-redux

MIT License
13 stars 1 forks source link

fix: export yjs to es2020 to support ssr #5

Open fredericrous opened 8 months ago

fredericrous commented 8 months ago

here is an example of vite setup to support ssr https://github.com/SebastianStehle/yjs-redux/issues/4 however I nuked the sample build. I think we could have a second vite config in the sample's folder. I don't know how you want to trigger it from package.json. also for the dev command, you might want to combine something like "vite build --watch && cd sample && vite"

SebastianStehle commented 8 months ago

Thanks. I have to dig into that later. I am not at my desk at the moment

SebastianStehle commented 8 months ago

Right now we do not even use vite for the build of the lib, why is your change needed? I don't really understand what you want to achieve exactly.

fredericrous commented 8 months ago

I used the only way I know to export correctly a lib with rollup and vite, but feel free not to use vite. goal is to be able to not get the library throw in a node context. the error was something like cannot find the module binder-hooks.ts

SebastianStehle commented 8 months ago

I could not find any good samples for libs plus samples so I was looking for a solution that works great for development. if you want to improve it, you should also try to handle the sample. A separate project would be fine for me.