Stedefast

stedefast preview

1 min read

stedefast preview

The preview command runs a local preview of your built site using Wrangler Pages. This lets you test your site exactly as it will behave on Cloudflare Pages, including dynamic modules served via Pages Functions.

stedefast preview [options]

Requirements

Wrangler must be available. Install it as a dev dependency (recommended):

pnpm add -D wrangler

Or globally:

npm install -g wrangler

Run stedefast build first — preview serves the existing dist/ directory.

Options

Option Default Description
--config <path> ./stedefast.config.ts Path to Stedefast config
--port <port> 8788 Port to listen on
--dist <dir> From config Override output directory to serve

Example

# Build first
stedefast build

# Then preview
stedefast preview

# Custom port
stedefast preview --port 4321

How It Differs From stedefast dev

Feature stedefast dev stedefast preview
Watches for file changes Yes No
Live reload Yes No
Rebuilds on change Yes No
CF Pages Functions No (Node mock) Yes (via Wrangler)
D1 / KV bindings Miniflare mock Wrangler local bindings
Best for Active development Pre-deploy verification

Use stedefast preview when you want to verify your site behaves correctly with the real Cloudflare runtime before running stedefast deploy.