I have a custom library com.foo.library I would like to include as a dependency of a Fiori-like app I have built.
SAP Fiori Launchpad for Developers -> Best Practice
In your Fiori App:
Put your dependencie into the app descriptor (manifest.json) (or if no app descriptor used into the config inside the Component.js)
dependencies: {
libs: ["sap.m", "sap.ui.layout", "com.foo.library"],
components: [com.foo.component]
}
Let sap.ui.core know where to search for the namespace of your library.(Top of your Component.js)
jQuery.sap.registerModulePath("com.foo", "/Path/on/the/server/");
And now you can use your dependencies. And here is why:
Before a module is loaded, the longest registered prefix of its module name is searched for and the associated URL prefix is used as a prefix for the request URL. The remainder of the module name is attached to the request URL by replacing dots ('.') with slashes ('/').
The registration and search operates on full name segments only.
Source: SAP UI5 API Documentation