The AMD specification originates from the TRANSPORT/C specification in Commonjs, in the following format:
Define (ID?, dependencies, Factory);
Module Name specification:
1. Module name consists of: multiple string name or '/';
2. String name follows the hump rule, or: '. ', '. ' ;
3. Module name is forbidden with extension, such as: '. js ';
4. Top-level Path module name starts with the root space, relative path module name: With '. ', '. ' Start
Dependency specification:
1. If it is ["require", "exports", "module"], follow the COMMONJS specification, otherwise inject the parameter as a parameter list in factory.
Factory Specification:
1. No dependent parameters, through ToString to require dependence, dependent parameters are accessed by dependent parameters;
2. Reliance on first execution, factory execution;
Define.amd Property
1. AMD attributes identify that the Define function complies with the AMD specification to distinguish it from non-compliance with AMD's define functions;
2. If the AMD specification is updated, the AMD2 attribute will be the name;
3. The value of the AMD attribute is an object, but the object specific content has the implementation of the customization;
Relationship with Commonjs:
1. As long as the COMMONJS (NodeJS) factory in the absence of synchronized require can be common, because the browser side is not supported, but also the performance impact.
Relive AMD, CMD