I built my extension using Crossrider and at the moment all my code is in the extension.js file. However, it's getting rather long and becoming more difficult to maintain in this monolithic file. Is there a way to split my code into separate files and still use them in my extension?
So for example, if I my extension.js file is structured like the following example, I would like functions f1 & f2 to be in a separate file that I can load into the extension:
appAPI.ready(function($) {
init();
f1();
f2();
...
function init() {
// init code
...
}
function f1() {
//hundreds of lines of code
}
function f2() {
//hundreds of lines of code
}
...
});