```typescript
/** The KEY=VALUE pairs of a config file. */
export function parseConfig(text: string): Record<string, string> {
  const config: Record<string, string> = {};
  for (const line of text.split("\n")) {
    if (line.trim() === "") continue; // Skip blank lines

    const [key = "", value = ""] = line.split("=", 2).map(item => item.trim());
    if (!key) throw new Error(`Line ${i + 1} does not have a key.`);

    if (Object.prototype.hasOwnProperty.call(config, key)) {
      console.warn(`Warning: Duplicate key '${key}' ignored in line ${i + 1}.`);
      continue;
    }

    config[key] = value;
  }
  return config;
}
```