Loomix's avatar

Laravel Mix - If at all / using it to what extent?

I am new to the Laravel world and this question is about best practise and recommendation: My project uses JQuery, Bootstrap (including some plugins), all the core js of Laravel and some small js files by me. The bootstrap template I am using (Material Dashboard Pro) has several js files as well.

Now my project is ready for demo and I thought it would be nice to have all(!) js files of the entire project bundled to one minified app.js. is this even recommended or are there certain disadvantages by doing so? Is it wise to bundle JQuery and the template js files as well? What is best performance-wise? What is most convenient for switching development and production? Thanks.

This is my current directory structure containing js files:

/public/js/ : (empty)

/public/material/js/ : material-dasboard.min, material-dashboard.js, some js by me)

/public/material/js/core/ : (bootstrap.min, jquery.min, popper.min)

/public/material/js/plugins/ : ( several jquery and bootstrap js of plugins, like bootstrap-notify etc.)

0 likes
1 reply
mkshingrakhiya's avatar

Yes. It is better than serving too many smaller assets. However, To further improve the assets serving in your Laravel application, see Vendor Extraction part of the Laravel Mix.

Please or to participate in this conversation.