The obvious problem here is that you might have dependencies that rely on "mymod.default.js", but if "mymod.custom.js" gets loaded instead those dependencies will break.
The solution to this is to provide a fake file in both "mymod.default.js" and "mymod.extend.js" and then use that for dependency checks:
Fake provide in mymod.default.js and mymod.extend.js
// The normal provide() lets you check later which file was loaded...
Check.provide(self);
// The fake provide() lets you check that any settings were loaded...
Check.provide({
file: "settings.loaded",
ver : self.ver
});
If you're particularly paranoid about having both file somehow get loaded, you can make sure "settings.loaded" isn't loaded during dependency checks at the top of those files...
Make sure settings not already loaded in mymod.default.js and mymod.extend.js...
var dependencies = {
"Util.js": Check.ANY_VERSION,
"settings.loaded": Check.NOT_LOADED
}
// will throw error if "settings.loaded" already loaded...
Check.required(dependencies, self);