()
| 30 | } |
| 31 | |
| 32 | public async loadMeta(): Promise<MicroApplication[]> { |
| 33 | if (await this.productionLoader.enabled()) { |
| 34 | // 加载微前端资源配置 |
| 35 | const production = await this.productionLoader.loadMeta(); |
| 36 | // 加载微前端设置配置 |
| 37 | await this.settingLoader.loadSetting(); |
| 38 | // 如果启用开发者模式,则加载开发者微前端资源配置 |
| 39 | if (await this.developmentLoader.enabled()) { |
| 40 | const dev = await this.developmentLoader.loadMeta(production); |
| 41 | if (!isEmpty(dev)) { |
| 42 | debug('MicroApplicationDevelopmentLoader meta config mount'); |
| 43 | return dev; |
| 44 | } |
| 45 | } |
| 46 | debug('MicroApplicationAPILoader meta config mount'); |
| 47 | return production; |
| 48 | } |
| 49 | message.error('微前端启动失败', 0); |
| 50 | throw new Error('微前端启动失败'); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | const loader = new CombineLoader(apiLoader, developmentLoader, settingLoader); |
no test coverage detected