Way to bundle all javascript files on site, including addon

Vote:
 

Hello,

I've a Epi CMS 7.5 Project, consisting of 15+ addons. Each addon potentially have its own scripts appended with this approach in a ClientResources class:

requiredResources.RequireScript(UrlHelperExtensions.GetAddonContent("~/Scripts/foo.js")).AtHeader();

Is there a way to bundle all these scripts into a minified one?

Thanks in advance

#163316
Oct 20, 2016 12:56
Vote:
 

Might be achievable my intercepting RequiredResources class and doing some black magic there. If somebody adds required script, then actually read the file store in memory and at the end of the request bundles. But it's tricky and I'm wondering about real purpose of trying to bundle all scripts? What is reason behind this? Whole idea of client resources was to provide flexibility to add / remove stuff that's needed.

#163446
Oct 20, 2016 15:40
Vote:
 

Thank you for your input. The motive is to be able to minify and bundle all scripts which means smaller scripts and fewer loads.

#163480
Oct 21, 2016 9:00
Vote:
 

Yes, definitely. It makes sense to do that for your site scripts and styles. Not sure whether it's good ideas to force it on add-ons and other "dynamically" added components.

#163805
Oct 21, 2016 17:33
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.