Category: Laravel, javascript

This article will outline how to lazy load (dynamically load) VueJS Single File Components When making large sites that utilize lots of components by default they are all bundled into the js/app.js file and that file can get very large.

We register our components in resources/js/app.js, this will allow us to use them in our blade templates later.

That is all we have to do, we do not need to change the code on our views or update our components. Time to recompile: now we see something like this: Our components have been split up into their own JS files and we can see that app.js is smaller than before.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners