Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RequireJS - jQuery is undefined when certain alias is given

When setting the path for jQuery, whenever I am using:

require.config({
    paths: {
        'jQuery': './libs/jquery-1.8.0.min'
    }
});

Then:

define(['jQuery'], function($) {
    console.log($);
};

$ is gonna be undefined.

However if I am using:

require.config({
    paths: {
        'jquery': './libs/jquery-1.8.0.min'
    }
});

Then:

define(['jquery'], function($) {
    console.log($);
};

Everything is working great all in a sudden.

What's the issue with defining jQuery's alias with jQuery?

like image 258
gsklee Avatar asked Aug 25 '12 10:08

gsklee


1 Answers

This was discussed more over here: https://github.com/jrburke/requirejs/issues/435

like image 179
jrburke Avatar answered Sep 28 '22 06:09

jrburke