API Reference

Document

Document represents one page entry such as @/pages/home.

Document represents one page entry such as @/pages/home.

ts
import { dev } from 'reactus';

const engine = dev({ cwd: process.cwd() });
const document = await engine.set('@/pages/home');

Properties

PropertyTypeDescription
entrystringEntry identifier such as @/pages/home.
serverServerParent Server or Builder.
builderDocumentBuilderPer-document build helper.
loaderDocumentLoaderPer-document file and module loader.
renderDocumentRenderPer-document HTML renderer.
idstringGenerated id based on the entry path.

Notes

  • id is derived from the entry path and file basename.
  • Valid entry formats include project-root paths such as @/pages/home and package-style paths such as reactus-with-plugin/pages/contact.
  • The Document object is mostly a coordinator. The actual work happens in its builder, loader, and render helpers.