CLI
The @pracht/cli package provides three commands for development, building, and previewing your app.
pracht dev
Starts the Vite dev server with SSR middleware, HMR, and instant feedback.
pracht dev
# Custom port
PORT=4000 pracht devRoutes are rendered server-side on each request. Changes to routes, shells, loaders, and components are reflected immediately via HMR.
pracht build
Runs a production build: client bundle, server bundle, and SSG/ISG prerendering.
pracht buildOutput:
dist/client/โ static assets with hashed filenamesdist/server/server.jsโ server entry module- SSG routes are pre-rendered as static HTML in
dist/client/
pracht preview
Runs the production server entry locally. Useful for smoke-testing the build before deploying.
pracht preview
# Custom port
PORT=4000 pracht previewInstallation
The CLI is included in scaffolded projects. For existing projects, add it as a dev dependency:
pnpm add -D @pracht/cliThen add scripts to your package.json:
package.json
{
"scripts": {
"dev": "pracht dev",
"build": "pracht build",
"preview": "pracht preview"
}
}