Skip to content

Deploy a static website

You must have Node.js installed.
Minimum supported version is 20.x, but using the latest stable version is recommended.

You can also use LikeC4 Docker.

Run build command, that prepares a folder with static files ready to be deployed to any host.

Terminal window
npx likec4 build -o ./dist

Available options:

OptionDescription
-o, --outputOutput directory
--baseBase URL the app is being served from, e.g. ”/”, “/pages/” or ”./” for a relocatable app
--use-hash-historyHash-based navigation, e.g. ”/#/view” instead of “/view”
--use-dotUse local binaries of Graphviz (“dot”) instead of bundled WASM
--titleBase title of the app pages (default is “LikeC4”)
--output-single-fileGenerates a single self-contained HTML file

To see all available options run:

Terminal window
npx likec4 build -h

LikeC4 CLI uses Vite to build the website.

All the examples from Vite documentation apply to LikeC4, just replace vite build with likec4 build.