-
-
Notifications
You must be signed in to change notification settings - Fork 105
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 of routers? #31
Comments
Hi @hmmhmmhm I have not tried this, but it should work. However, what you need to keep in mind is that the async function would be executed when the route object is defined. So, yes, you'd get code splitting – but all routes would be loaded at the same time, on page load. If you want true async loading, then a possible way is to add to the router a route whose sole job is to load the Author route asynchronously. If you want to modify this router to support async route loading, you're welcome to submit a PR :) |
I just searched and found a module called svelte-loadable, and I have succeeded in implementing asynchronous loading through this module. I'll check the structure of the svelte spa router, and if possible, I'll do PR. thanks for answer! |
https://github.com/hmmhmmhm/svelte-spa-chunk I maded a async route loading module for svelte-spa-router. I think it would be more efficient to introduce |
Thanks for that. I like your solution, and I think it looks very elegant. I'm happy to include a note in the Advanced Usage readme. Let's continue in #36 |
Add Async Route Loading ItalyPaleAle#31
I have recently focused on developing the Svelte project using Parcel.... By the way, I wonder if the code splitting of parcel can be applied to the routes index map of spa router.
The text was updated successfully, but these errors were encountered: