(dir: string)
| 253 | } |
| 254 | |
| 255 | function listHtmlFiles(dir: string): string[] { |
| 256 | const files: 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; |
| 274 | } |
| 275 | |
| 276 | export function injectTailwindBrowserScript(html: string): string { |
| 277 | if (html.includes(TAILWIND_BROWSER_SRC)) return html; |
no test coverage detected