(dir)
| 39 | ]); |
| 40 | |
| 41 | function getAllMdxFiles(dir) { |
| 42 | const out = []; |
| 43 | (function walk(p) { |
| 44 | for (const entry of fs.readdirSync(p, { withFileTypes: true })) { |
| 45 | const full = path.join(p, entry.name); |
| 46 | if (entry.isDirectory()) walk(full); |
| 47 | else if (MDX_EXTS.includes(path.extname(entry.name).toLowerCase())) out.push(full); |
| 48 | } |
| 49 | })(dir); |
| 50 | return out; |
| 51 | } |
| 52 | |
| 53 | function fileExists(p) { |
| 54 | try { |