(currentDir: string)
| 257 | const ignoredDirs = new Set([".git", "dist", "node_modules"]); |
| 258 | |
| 259 | function walk(currentDir: string): void { |
| 260 | for (const entry of readdirSync(currentDir, { withFileTypes: true })) { |
| 261 | const entryPath = join(currentDir, entry.name); |
| 262 | if (entry.isDirectory()) { |
| 263 | if (!ignoredDirs.has(entry.name)) walk(entryPath); |
| 264 | continue; |
| 265 | } |
| 266 | if (entry.isFile() && entry.name.endsWith(".html")) { |
| 267 | files.push(entryPath); |
| 268 | } |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | walk(dir); |
| 273 | return files; |