* Helper to add a property to the nuxt config content.
(configContent: string, property: string)
| 582 | * Helper to add a property to the nuxt config content. |
| 583 | */ |
| 584 | function addConfigProperty(configContent: string, property: string): string { |
| 585 | // Find a good insertion point - after any existing property or at the start |
| 586 | const trimmed = configContent.trim() |
| 587 | if (trimmed.length === 0) { |
| 588 | return `\n ${property},\n` |
| 589 | } |
| 590 | // Add after the first line break or at the start |
| 591 | if (configContent.startsWith('\n')) { |
| 592 | return `\n ${property},${configContent}` |
| 593 | } |
| 594 | return `\n ${property},\n${configContent}` |
| 595 | } |
| 596 | |
| 597 | /** |
| 598 | * Builds the formkit.config.ts file. |