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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners