Closed absowoot closed 5 months ago
Take a look at https://github.com/woutdp/live_svelte/discussions/57#discussioncomment-6289249 maybe. It's using Vite.
Switching to Vite seems counter-intuitive. I really enjoy the ease of using (live_)svelte and especially the ability to include all component-related code in one file but this puts a pause on my switch to live_svelte.
I think with Vite you'd still be able to use live_svelte like regular as before, except that modules will be loaded dynamically. I've never tested it out though so I might be wrong here...
Closing for now
If you import a heavy dependency, like Maplibre, it increases the bundle size drastically. I was able to figure this out for standard Phoenix applications with help from this thread but attempting this with live_svelte results in the following error:
Cannot use import statement outside a module
Is code splitting possible with live_svelte and/or loading component dependencies on demand?
Seemingly related to #36