Use this when your app is generated by rtgl sites and you want VT with no custom JavaScript and local-versioned CLI usage through package scripts.
package.json:
{
"scripts": {
"watch": "rtgl sites watch -p 4173 -o dist --quiet",
"build": "rtgl sites build -o dist",
"generate": "rtgl vt generate",
"screenshot": "rtgl vt screenshot",
"report": "rtgl vt report",
"accept": "rtgl vt accept"
}
}
Minimal setup
rettangoli.config.yaml:
vt:
path: ./vt
url: http://127.0.0.1:4173
service:
start: npm run watch
sections:
- title: pages
files: pages
Why this command
watchrunsrtgl sites watch, which does initial build, serves output, and stays running.- VT can start/stop it automatically via
vt.service.start. buildruns a production output build withrtgl sites build -o dist.- Scripts use the project-local
rtglbinary.
Run VT
npm run generate
npm run screenshot
npm run report
npm run accept
Notes
- Keep
vt.urland-pon the same port. -o distis optional; default output is_site.- If your preview server is already running elsewhere, you can omit
vt.serviceand keep onlyvt.url.
Optional: Markdown codePreview blocks
If your Sites pages include fenced blocks like:
```html codePreview
<rtgl-button>Click</rtgl-button>
```
Enable it in sites.config.yaml:
markdownit:
codePreview:
enabled: true
showSource: true
theme: slack-dark