site

tcmts.dev.site · #ghgbhqyk · term · runs on the server

uses node:path

Build the docs site (pnpm docs:site, which is pnpm tcm run tcmts.dev.site) into out, dist/site by default.

import { buildSite, repository } from "#codebase/tcmts/dev";
import path from "node:path";

export async function site(out?: string): Promise<void> {
  const to = path.resolve(out ?? path.join(repository(), "dist", "site"));
  const r = await buildSite(to, { large: true });
  for (const p of r.problems) console.error(`docs site: ${p}`);
  if (!r.problems.length)
    console.log(`docs site: ${r.pages} pages in ${path.relative(process.cwd(), to) || to}`);
  process.exitCode = r.problems.length ? 1 : 0;
}

uses