I'm looking to include a few JS files (some libraries, others are custom modules with dependencies on libraries). Originally I had all JS files added through our .info file, and while I could control the order of the files manually my moving them up and down, that would result in all the JS files loading on every page.
Is it a better idea to add JS files through template.php in the template_preprocess_html function? For each JS file I can attach a group property (one of the constants of JS_Library, JS_DEFAULT, or JS_THEME) to control the ordering, and also control which pages need to load which files.
Thoughts?
hook_js_alter()
or to add all of them intemplate_preprocess_html()
, which would certainly work but I'm not sure if it has drawbacks.