Support the ongoing development of Laravel.io →
Configuration Views Architecture
Last updated 1 year ago.
0

I've never used Basset so I"m not familiar with the idea of collections but maybe you are over thinking this.

Why not compile all css down to one app.css and load that from every page. app.css is loaded once in the master template.

Its easy with gulp to create source maps with just one setting which will allow you to view which file the original less is from in your browser dev tools.

Same goes for js/coffeescript. Just keep 1 app.js which is built from all your coffee/js files. If you have one js heavy page or individual widgets you can always build and include those separately if you only want to add the loading burden to the 1 page it realates to.

Last updated 1 year ago.
0

I guess the "one single CSS file" solution is probably easiest. One of the things I liked about Basset was being able to tailor the CSS/Javascript for each page - for example, my "list users" page doesn't need my "forms" javascript, so it doesn't load it. But this app is strictly intranet only, so bandwidth is not a real concern. Thanks for your suggestion!

Last updated 1 year ago.
0

The trade off is 1 big load vs many small loads. Once the initial load of the bundled app.css has been done on the initial load, the browser will cache it for each subsequent request. With loading only each pages css rules, each different page will have to be viewed more than once to benefit from the browsers caching.

Last updated 1 year ago.
0

Yes just cache your assets forever, and you will only have to load 1 file the first time, the other times nothing at all. And you can compress with gzip (usually automatically) so it normally isn't that big.. (most images are larger then the css files..)

Last updated 1 year ago.
0

I think I've been overthinking this :-)

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.