| 99 | } |
| 100 | |
| 101 | async function resolveLoadedPlugins<T extends { plugin?: ConfigPluginV1.Spec[] }>(config: T, filepath: string) { |
| 102 | if (!config.plugin) return config |
| 103 | for (let i = 0; i < config.plugin.length; i++) { |
| 104 | // Normalize path-like plugin specs while we still know which config file declared them. |
| 105 | // This prevents `./plugin.ts` from being reinterpreted relative to some later merge location. |
| 106 | config.plugin[i] = await ConfigPlugin.resolvePluginSpec(config.plugin[i], filepath) |
| 107 | } |
| 108 | return config |
| 109 | } |
| 110 | |
| 111 | type Info = ConfigV1.Info & { |
| 112 | // plugin_origins is derived state, not a persisted config field. It keeps each winning plugin spec together |