CLI

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 build

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

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 knip
import { knipConfig } from 'sitelo/knip'

export default knipConfig()
npx knip

knipConfig() 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
})