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
| Property | Type | Description |
|---|---|---|
entry | string | Entry identifier such as @/pages/home. |
server | Server | Parent Server or Builder. |
builder | DocumentBuilder | Per-document build helper. |
loader | DocumentLoader | Per-document file and module loader. |
render | DocumentRender | Per-document HTML renderer. |
id | string | Generated id based on the entry path. |
Notes
idis derived from the entry path and file basename.- Valid entry formats include project-root paths such as
@/pages/homeand package-style paths such asreactus-with-plugin/pages/contact. - The
Documentobject is mostly a coordinator. The actual work happens in itsbuilder,loader, andrenderhelpers.