index.js
function getRoute(id){
            if(id.indexOf(':')>-1){
                var arr = id.split(':');
                var prefix = arr[0];
                if(prefix.indexOf('/')>-1){
                    return prefix;
                }else{
                    return config.baseName + '/' + prefix;
                }
            }else{
                // core 模块下的所有json文件
                if(coreMap[id]){
                    return coreMap[id];
                }else{
                    var corePath = path.join(root, config.coreName);
                    var arr = fs.readdirSync(corePath);
                    arr.forEach(function(v){
                        var modulePath = path.join(corePath, v);
                        var jsonPath = path.join(modulePath, 'map.json');
                        if(fs.existsSync(jsonPath)){
                            try{
                                var _route = config.coreName+'/'+v;
                                var json = jsonCache[_route] = JSON.parse(fs.readFileSync(jsonPath));
                                var res = json.res;
                                for(var i in res){
                                    coreMap[i] = _route;
                                }
                            }catch(err){
                                throw err;
                            }

                        }
                    });
                    if(coreMap[id]){
                        return coreMap[id];
                    }else{
                        throw new Error('无法找到['+id+']对应的文件');
                    }
                }
            }
        }
function getRoute(id){
            if(id.indexOf(':')>-1){
                var arr = id.split(':');
                var prefix = arr[0];
                if(prefix.indexOf('/')>-1){
                    return prefix;
                }else{
                    return config.baseName + '/' + prefix;
                }
            }else{
                // core 模块下的所有json文件
                if(coreMap[id]){
                    return coreMap[id];
                }else{
                    var corePath = path.join(root, config.coreName);
                    var arr = fs.readdirSync(corePath);
                    arr.forEach(function(v){
                        var modulePath = path.join(corePath, v);
                        var jsonPath = path.join(modulePath, 'map.json');
                        if(fs.existsSync(jsonPath)){
                            try{
                                var _route = config.coreName+'/'+v;
                                var json = jsonCache[_route] = JSON.parse(fs.readFileSync(jsonPath));
                                var res = json.res;
                                for(var i in res){
                                    coreMap[i] = _route;
                                }
                            }catch(err){
                                throw err;
                            }

                        }
                    });
                    if(coreMap[id]){
                        return coreMap[id];
                    }else{
                        throw new Error('无法找到['+id+']对应的文件');
                    }
                }
            }
        }
获取核心模块的 familyName/moduleName