Open fredericrous opened 8 months ago
Thanks. I have to dig into that later. I am not at my desk at the moment
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.
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
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.
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"