import { readFileSync, writeFileSync, unlinkSync, readdirSync, statSync } from "fs"; import { join } from "path"; const distDir = "./dist"; function walk(dir, callback) { for (const entry of readdirSync(dir)) { const fullPath = join(dir, entry); const stats = statSync(fullPath); if (stats.isDirectory()) { walk(fullPath, callback); } else { callback(fullPath, stats); } } } // Remove noModule script tags from all HTML files let htmlCount = 0; walk(distDir, (filePath) => { if (filePath.endsWith(".html")) { let content = readFileSync(filePath, "utf-8"); const before = content.length; // Remove both