Answer the question
In order to leave comments, you need to log in
How to optimize laravel + vue?
Hello.
There is a festival site, a backend - Laravel, all sorts of goodies like a slider, modals, animations, galleries, forms, and so on - made on Vue - connected in one place - app.js. And as you understand, the site is updated all the time, there are more than 70 components + all sorts of libraries that are also loaded there.
And here's the question. I'm looking at the main page now, and I see that a bunch of garbage is added there, which is not used in any way on this page. How to make it so that only the necessary components are connected there?
As an option - yes, you can create a separate js for each page, connect only the necessary components there.
But what else can be done in this case?
Answer the question
In order to leave comments, you need to log in
Hello. You need to forego the bridge that Laravel provides out of the box for making connections with Vue. In general, to move from laravel-mix to vue-cli, which already has both code splitting and dynamic imports - whatever you want. I am attaching a link to a video on how to make friends with laravel and vue in this way: https://www.youtube.com/watch?v=PJNIE8lYLMQ
I don't know why, here the Vue curator left a comment about components and suggested using this .
But if the answer and my comment were deleted, then this method will not help me or what? Why delete the answer at all, it's better to write that you made a mistake or something else.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question