bash
pup author preview [flags]Preview.json
You may use a preview.json to control the preview command:
preview.json
{
"variables": { "componentName": "Button" },
"exec": "npm install && npm run dev",
"outputDir": "preview", // <--- default
"watch": true
}Flags win over preview.json. Missing required variables
abort the preview and list what’s missing.
Flags
| Flag | Short | Type | Description |
|---|---|---|---|
--exec |
-e |
string | Shell command to run inside the preview dir (overrides preview.json) |
--output-dir |
-o |
string | Preview output directory (default: preview) |
--watch |
-w |
boolean | Watch powerup sources and re-render on change (default: true when --exec is set) |
Template variables can also be passed as flags:
bash
pup author preview --component-name=Button --theme=dark