In a custom lightning aura component app, I have a component where I want to include a static resource.
I have successfully created the static resource (a JavaScript file) and included it in the component like so:
<!-- someComponent.cmp -->
<aura:component controller="SomeController" implements="..." access="global">
<ltng:require scripts="{!$Resource.GlobalJs}" />
</aura:component>
Now there may be other static resources or components that I'd like to include in the future, for all components. I don't want to have to add each global entity to every component every time I realize I need a new global resource. So - is it possible to create a component solely for the purpose of including global static resources and other components?
I tried creating such a component like this...
<!-- globalIncludes.cmp -->
<aura:component>
<ltng:require scripts="{!$Resource.GlobalJs}" />
</aura:component>
...and then including that inside the main component like this:
<!-- someComponent.cmp -->
<aura:component controller="SomeController" implements="..." access="global">
<c:globalIncludes/>
</aura:component>
But this doesn't appear to be working - I'm getting a JavaScript error as if the JavaScript file wasn't included properly. Is it possible to do what I'm trying to do? Am I doing something wrong?