CLI
On this page
The sitelo CLI wraps the bundled Vite and auto-injects the HTML pages plugin.
Commands
sitelo # same as sitelo dev
sitelo dev # development server
sitelo build # production build
sitelo preview # preview the production build
sitelo lighthouse # audit the production builddev— real SSR renders on request, including dynamic routes, plus a small dev toolbarbuild— static HTML indist/(or youroutDir)preview— serve the production build locallylighthouse— audit the production build (needs thelighthousepeer dependency)
Disable the toolbar with devToolbar: false in sitelo.config.js — see Configuration.
Useful flags
sitelo --port 8888
sitelo build --outDir public --emptyOutDir
sitelo --root docs--port/--host/--open— server--outDir/--emptyOutDir/--base— build--root— project root (handy for adocs/site)--config— custom Vite config file--mode/--logLevel/--debug
Prefer Vite options in sitelo.config.js under vite for anything you reuse across commands.
Finding unused code
knip finds files, exports and dependencies nothing uses. On a sitelo project it needs one hint: pages and islands are discovered from the filesystem, so nothing imports them, and without being told otherwise knip reports the whole site as unused files.
npm install -D knipimport { knipConfig } from 'sitelo/knip'
export default knipConfig()npx knipknipConfig() reads your sitelo.config.js and marks the pages and islands as entry points the same way the build discovers them — pagesDir, pageExtensions, include and exclude all apply. What is left in the report is code the site genuinely never reaches.
One thing it cannot see: a client script a page references by URL rather than import, like <script src="/js/app.js">. List those yourself, and pass anything else knip accepts alongside — it is spread into the result. The trailing ! is knip’s marker for production code, which is what a script shipped to the browser is.
export default knipConfig({
entry: ['src/js/app.js!'], // what the pages load with a <script src>
ignore: ['legacy/**'], // and anything else knip accepts
})