Small AMD loader for bundled AMD modules. No dynamic loading or loader plugin support.
define(id, deps, factory)
argument | type |
---|---|
id | string |
deps | array |
factory | function |
All modules must have IDs and dependency arrays in their define() calls. See AMD define().
; ; ;
require(id)
argument | type |
---|---|
id | string |
Synchronously returns the module export for the module ID represented by the id
argument. Modules and all dependencies must be defined before calling this function as it does not do dynamic loading. See AMD require().
var $ = ;
;
Usage
npm install require.js
Bundle require.js with other scripts. It should be added before named or bundled AMD modules.
;
;
It can also be included before bundled amd modules.
;