You also need to include MyCustomModule
in paths
:
requirejs.config({
paths: {
'text': 'durandal/amd/text'
'MyCustomModule': 'path/to/MyCustomModule'
},
shim: {
'MyCustomModule': {
exports: 'My.Custom.Module'
}
}
});
If you don't do that, define(['MyCustomModule'] (...)
will look for the dependency in the baseUrl
location, in your case: app/MyCustomModule
.
In other words: shim
can't "pick up" global variables that are not loaded by RequireJS.