BASEURL: Find root path for all modules.
- The BaseURL is not used when loading a pure. js file (the dependent string starts with/begins with, or ends with. js, or contains a protocol ).
- If BaseURL is not explicitly set, the default value is where the HTML that loads the Require.js is located. If you use theData-mainproperty, the path becomes baseurl.
- The BaseURL can be in a different domain than the Require.js page, and the Requirejs script is loaded across domains.
Paths :path maps the name of a module that is not placed directly under BaseURL. The start position when you set path is relative to BaseURL, unless the path setting starts with "/" or contains a URL protocol (such as http:).
the path used for the module name should not contain the. js suffix, because a path may be mapped to a directory. The path resolution mechanism automatically adds the. js suffix when mapping the module name to path. When you use Require.tourl () in a scene such as a text template, It also adds the appropriate suffix.
Shim: For those that do not use define () to declare dependencies, set the module's "Browser global variable Injection" script to do the dependency and export configuration.
map : For a given module prefix, use a different module ID to load the module.
Config : It is often necessary to pass configuration information to a module. These configurations are often application levels of information and require a means to pass them down to the module. In Requirejs, the config configuration item based on the Requirejs.config () is implemented. To get this information the module can load a special dependent "module" and call Module.config ().
Configuration of the Requirejs