RequireJS Tutorial on RequireJS jQuery

requirejs uses jquery as another dependency and registers as named module jquery in lowercase and by default, also registers itself by using the global functions $ and jquery while using the amd/requirejs.

loading jquery

require(['jquery'], function($) {
   //code here
}

you can load multiple and custom libraries along with the jquery as shown below −

require(['custom_library_path','jquery'], function(load_library,$) {
   //related code of $ and load_library
});  

the following table shows the use of jquery with requirejs for specifying their dependencies.

sr.no. types & description
1 using shim config

jquery uses shim configuration to define the dependencies for jquery plugins.

2 loading jquery from cdn

jquery uses cdn to define the dependencies for jquery plugins.