Skip to content

kumiko build

Terminal window
kumiko build [<path>]

Convention-driven production build. Runs Bun.build, the Tailwind compile, and a public-folder copy, then writes everything to dist/.

In an app, bun run build runs the kumiko-build binary from @cosmicdrift/kumiko-dev-server. It writes the client to dist/ and the server bundle to dist-server/.

SourceUsed when
<path> argIf you pass one
$INIT_CWDYarn sets this, bun run build runs cleanly from any workspace
process.cwd()Last resort

In practice: run bun run build inside an app workspace and it Just Works.

✓ build done, 312KB in 1.4s
out/ dist/
bundles client.js, server.js
static 127 files copied

The output is what you ship, copy dist/ to a container image or upload it to your CDN. No further postprocessing required.

An app with one browser entry at src/client.tsx needs no configuration. An app with more than one entry declares them in package.json:

{
"kumiko": {
"clientEntries": [
{ "name": "public", "sourceFile": "./src/client-public.tsx" },
{ "name": "admin", "sourceFile": "./src/client-admin.tsx", "htmlPath": "./public/admin.html" }
]
}
}

For a single entry at a different path, "kumiko": { "clientEntry": "./src/app.tsx" } is enough. The build checks the declaration:

  • name matches ^[a-z][a-z0-9-]*$ and is unique
  • two entries cannot share a source file name or an HTML output file
  • every sourceFile exists and stays inside the app directory
  • htmlPath is optional and must end in .html
  • clientEntry and clientEntries are mutually exclusive, and an empty list is an error

The build no longer infers entries from file names. If it finds files such as src/client-admin.tsx without a declaration, it stops:

[kumiko build] found <files> but no "kumiko.clientEntries" declaration in package.json — production builds no longer infer entries from filenames (fw#2320). Add:

followed by a ready-to-paste declaration.

  • No code generation. kumiko codegen is gone; build only bundles.
  • No DB migrations. Build is read-only against the DB. Use kumiko schema apply for that.
  • No env validation. Build doesn’t read your .env. The bundle reads it at runtime.