RequireJS does not include required objects

given code below:

require.config({
    baseUrl: '',
    paths: {
        'jquery'    : 'js/lib/jquery',
        'text'      : 'js/lib/text',
        'underscore'    : 'js/lib/underscore',
        'icanhaz'   : 'js/lib/ICanHaz'
    }});

require(['jquery', 'icanhaz', 'underscore', "text!view/module/login/login.html"],
function ($, ich, _,loginHtml)
{   
   //jquery has value
   //icanhaz is undefined
   //_ is undefined
   //loginHtml has value

Can you please explain to me why jQuery and text have values where other files in the same folder do not and are undefined when code executes?

Answers


Because jQuery for example has a define call which returns jQuery:

define( "jquery", [], function () { return jQuery; } );

Other libraries don't have this. You can use shim config to solve this problem.


Need Your Help

Positioning Balloon ToolTips over TreeNodes

c# winforms treeview tooltip

I want to add a ToolTip to TreeView nodes and make a balloon appear at the mouse coordinates: