( rootDir: string, extConfigName: string, extConfigFilePath: string, )
| 132 | } |
| 133 | |
| 134 | async function loadExtConfigJS( |
| 135 | rootDir: string, |
| 136 | extConfigName: string, |
| 137 | extConfigFilePath: string, |
| 138 | ): Promise<ExtConfigPairs> { |
| 139 | try { |
| 140 | return { |
| 141 | extConfigType: 'js', |
| 142 | extConfigName, |
| 143 | extConfigFilePath: extConfigFilePath, |
| 144 | extConfig: await require(extConfigFilePath), |
| 145 | }; |
| 146 | } catch (e: any) { |
| 147 | fatal(`Parsing ${c.strong(extConfigName)} failed.\n\n${e.stack ?? e}`); |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | async function loadExtConfig(rootDir: string): Promise<ExtConfigPairs> { |
| 152 | const extConfigFilePathTS = resolve(rootDir, CONFIG_FILE_NAME_TS); |
no test coverage detected