Read this issue: https://github.com/jrburke/requirejs/issues/435
I understand that this is due to the way jquery defines itself. It uses the named define call:
define( "jquery", [], function () { return jQuery; } );
So if you need 'lib/jquery' , this will not work. To do this, you need to specify 'jquery' exactly.
EDIT:
If you want to put jquery in the lib/ folder, and your base url will be the parent folder of lib/ ( lib/../ ), you can use a pad as follows:
requirejs.config({ baseUrl: 'js', shim: { 'lib/backbone': { deps: ['lib/underscore', 'lib/jquery'], exports: 'Backbone' }, 'lib/underscore': { exports: '_' }, 'lib/jquery': { exports: '$' } } }); requirejs(['lib/jquery'], function($) {
Behrang
source share