code: function createLocalRequire( baseId ) {
          var requiredCache = {};
          function req( requireId, callback ) {
              if ( typeof requireId === 'string' ) {
                  var requiredModule = requiredCache[ requireId ];
                  if ( !requiredModule ) {
                      requiredModule =
                      requiredCache[ requireId ] =
                          nativeRequire( normalize( requireId, baseId ) );
                  }
  
                  return requiredModule;
              }
              else if ( isArray( requireId ) ) {
                  // 分析是否有resource，取出pluginModule先
                  var pluginModules = [];
                  each(
                      requireId,
                      function ( id ) {
                          var idInfo = parseId( id );
                          if ( idInfo.resource ) {
                              pluginModules.push(
                                  normalize( idInfo.module, baseId )
                              );
                          }
                      }
                  );
  
                  // 加载模块
                  nativeRequire(
                      pluginModules,
                      function () {
                          var ids = [];
                          each(
                              requireId,
                              function ( id ) {
                                  ids.push( normalize( id, baseId ) );
                              }
                          );
                          nativeRequire( ids, callback, baseId );
                      },
                      baseId
                  );
              }
          }
  
          /**
           * 将[module ID] + '.extension'格式的字符串转换成url
           *
           * @ignore
           * @param {string} source 符合描述格式的源字符串
           * @return {string}
           */
          req.toUrl = function ( id ) {
              return toUrl( normalize( id, baseId ) );
          };
  
          return req;
      }
docs: 创建local require函数
  
  @ignore
  @param {number} baseId 当前module id
  @return {Function}