Thanks for the clarification @PitaJ! I did a lot of experimenting but I guess I didn't get the right combination. I think I never tried naming the module with its extension. That might have been it. For anyone who might be interested in the actual solution, here it is:
In file-explorer.js:
define('azure/file-explorer', ['components'], function (components) {
const FileExplorer = {};
FileExplorer.init = function () {
// Init stuff here
});
return FileExplorer;
});
In plugin.json:
"modules": {
"azure/file-explorer.js": "static/lib/file-explorer.js"
},
In admin.js:
define('admin/plugins/azure', ['settings', 'azure/file-explorer'], function (settings, fileExplorer) {
fileExplorer.init();
});
In main.js:
$(document).ready(function () {
require(['azure/file-explorer'], (fileExplorer) => {
fileExplorer.init();
});
});