Open History to see the last commit
1import * as NodeFS from "node:fs";
2import * as NodePath from "node:path";
3import * as NodeURL from "node:url";
4
5// apps/docs builds the user docs for t3.codes/docs; this deployment serves them.
6const marketingDir = NodePath.dirname(NodePath.dirname(NodeURL.fileURLToPath(import.meta.url)));
7const docsDist = NodePath.join(marketingDir, "..", "docs", "dist");
8const target = NodePath.join(marketingDir, "dist", "docs");
9
10if (!NodeFS.existsSync(NodePath.join(docsDist, "index.html"))) {
11 throw new Error(`Expected a built docs site in ${docsDist}. Run the @t3tools/docs build first.`);
12}
13NodeFS.rmSync(target, { recursive: true, force: true });
14NodeFS.cpSync(docsDist, target, { recursive: true });