Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Splitting #88

Closed
absowoot opened this issue Oct 23, 2023 · 4 comments
Closed

Code Splitting #88

absowoot opened this issue Oct 23, 2023 · 4 comments

Comments

@absowoot
Copy link
Contributor

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

@woutdp
Copy link
Owner

woutdp commented Oct 23, 2023

Take a look at #57 (reply in thread) maybe.
It's using Vite.

@absowoot
Copy link
Contributor Author

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.

@woutdp
Copy link
Owner

woutdp commented Oct 23, 2023

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...

@woutdp
Copy link
Owner

woutdp commented Jan 17, 2024

Closing for now

@woutdp woutdp closed this as completed Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants