RequireJS - jQuery undefined when a specific alias is specified

When setting the path for jQuery when I use:

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

Then:

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

$ will be undefined.

However, if I use:

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

Then:

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

Everything works great fine.

What is the problem with jQuery alias definition with jQuery ?

+7
source share
1 answer

This has been discussed here in more detail: https://github.com/jrburke/requirejs/issues/435

+9
source

All Articles