vue-wordpress icon indicating copy to clipboard operation
vue-wordpress copied to clipboard

Lazy Load Routes

Open sethharris4989 opened this issue 5 years ago • 1 comments

This may be outside of the scope of the project, but can you give any insights or advice on getting code splitting/lazy loading routes to this theme?

Bundle sizes can get out of control, so having this would put this theme over the top of anything else I've found.

Thanks!

sethharris4989 avatar Jun 08 '19 21:06 sethharris4989

Just came across this post by accident. I had the same problem/question. Lazy loading routes is probably not a good idea, because it delays the time until you first see posts. So I added a global variable (in another theme) with wp-localize script and translated them from php to vue-router. You could probably prepare all routes in PHP and use that to initialize your Router (in JS).

schuhwerk avatar Sep 16 '20 22:09 schuhwerk