Libraries will load multiple times?


#1

If I am loading Bootstrap CSS and JS and a jQuery Library into several MODs (all within the very same project) , I wonder if I should maybe rather load those libraries inside the Head of my Document for once…

I wonder if it will be fine to load those libraries several times from within several Mods?

I might run into pageload-issues if those libraries get loaded too often?

Will Anymod take care of this and make sure the same CSS and JS Libraries will only be loaded once? Or should I take care of that myself by not loading them from within the Mods, but instead better load them via the head of my document?


#2

If a CSS or JS asset is present in multiple mods on the same page, it will still only be loaded once. Also, v2 will make the suggestion you just mentioned: it will tell you what to paste into the head of the page for faster loads!

And for further clarity, if you have an asset (like Bootstrap CSS) in a mod and also have a link or script element on your page, Anymod will not load it twice.


#3

Cool good to know, cheers