, . , , ".s", , , . "require.s.contexts" requrie:
base.js
contextReq = require.config({
context: 'mycontext',
baseUrl: 'http://www.example.com/src/',
paths:{
jquery: 'http://ajax.cdnjs.com/ajax/libs/jquery/2.0.3/jquery.min',
},
});
(function(){
contextReq(['require', 'topModule'], function(require, topModule){
topModule.initialize();
});
})();
setTimeout( function () {
console.log(require.s.contexts._);
console.log(require.s.contexts.mycontext);
}, 500);
:
{
[...]
defined: [],
[...]
}
{
[...]
defined: [
topModule: Object
nestedModule: Object
jquery: function (e,n){return new x.fn.init(e,n,t)}
],
[...]
}
, , : requireJS , , , , .