| 196 | const compositionsDir = resolve(projectDir, "compositions"); |
| 197 | if (existsSync(compositionsDir)) { |
| 198 | const collectHtmlFiles = (dir: string, rel: string): string[] => { |
| 199 | const out: string[] = []; |
| 200 | for (const entry of readdirSync(dir, { withFileTypes: true })) { |
| 201 | const relPath = rel ? `${rel}/${entry.name}` : entry.name; |
| 202 | if (entry.isDirectory()) out.push(...collectHtmlFiles(join(dir, entry.name), relPath)); |
| 203 | else if (entry.isFile() && entry.name.endsWith(".html")) out.push(relPath); |
| 204 | } |
| 205 | return out; |
| 206 | }; |
| 207 | const files = collectHtmlFiles(compositionsDir, "").sort(); |
| 208 | for (const file of files) { |
| 209 | const filePath = join(compositionsDir, file); |