woutdp / live_svelte

Svelte inside Phoenix LiveView with seamless end-to-end reactivity
https://hexdocs.pm/live_svelte
MIT License
1.01k stars 37 forks source link

Vite Installation Process #117

Closed cvkmohan closed 2 months ago

cvkmohan commented 3 months ago

Thanks for the great library.

The mix live_svelte.setup assumes the default esbuild and tailwind cli installation. However, if we move the asset management to vite ala https://mazaheri.dev/posts/vite-in-phoenix/ - running the mix live_svelte.setup creates a lot of issues. How do we setup live_svelte in such cases? I guess, my question can be renamed as "How do we manually install live_svelte"?

Thanks in advance.

woutdp commented 3 months ago

This might be useful to you: https://github.com/woutdp/live_svelte/discussions/57#discussioncomment-6289249

I haven't set up LiveSvelte with Vite so I'm not sure if it will work though!

cvkmohan commented 3 months ago

Thanks a lot for the link. Actually I have to apologize for not looking into Issues & Pull Requests before raising the issue. I could get overall direction. One question: In the build script we have optsClient and optsServer - is it like they are expecting two different js files namely app.js and server.js ? The imports in server.js are ssred?

woutdp commented 3 months ago

One question: In the build script we have optsClient and optsServer - is it like they are expecting two different js files namely app.js and server.js ? The imports in server.js are ssred?

Yes, server.js is for SSR and app.js is for the client.