import { emptyDir, writeFile } from "fs-extra"; import cpy from "cpy"; import { glob } from "glob"; import { writePage } from "./writePage"; //mise en place emptyDir("out", { recursive: true }); // clears the output folder await cpy(["input/**", "!input/**/*{.md,.jsx}"], "out", { flat: true }); //copies all the assets into out/ for (const file of await glob("input/**/*.md", { nodir: true })) { await writeFile( file.replace(/input[\/\w]*\//, "out/").replace(".md", ".html"), await writePage(file), ); }