Swaz's avatar
Level 20

Vendor extraction yes or no?

Just curious what everyone else is doing. I typically never bothered but recently I've been thinking I might as well use it. The only downside I see is that it's annoying to maintain the list of dependancies to extract in your webpack.mix.js file.

https://laravel.com/docs/8.x/mix#vendor-extraction

0 likes
6 replies
jlrdw's avatar

Probably not in the middle of development I would wait till you can say to yourself I won't be making changes now for a while, everything is good.

1 like
martinbean's avatar

@swaz I’ve never really bothered with it.

It would only be useful if you had a lot of “sections” to your app (say the front-end, back-end, etc) where you wanted to use say, Vue in both of them. You could extract vue which would theoretically reduce the size of your frontend.js and backend.js files (because Vue would be extracted, instead of being included in both).

1 like
Swaz's avatar
Level 20

Those are both good points, thank for the replies!

martinbean's avatar

@Swaz But do you have lots of individual entry points using the same libraries? Because if not, all you’ve done is split your JS over three files that require three separate HTTP requests to load now, instead of just one.

1 like
Swaz's avatar
Level 20

@martinbean What do you mean by individual entry points?

My vendor libraries hardly ever change, but my appjs changes daily. I like that the vendor file can stay cached and the client only needs to re-download the file that has actually changed. Am I missing something here?

I thought separate requests was no longer an issue with Http2 multiplexing.

Please or to participate in this conversation.