Each source folder builds independently.
sh
pnpm build # all source folders
pnpm build front # specific folderπ¦ Build Output β
txt
dist/
βββ front
βββ api
β βββ app.js # app factory (Koa) / app instance (Hono)
β βββ server.js # bundled API server
βββ client
β βββ assets/ # scripts, styles, images
β βββ index.html
βββ ssr
βββ app.js # SSR app factory (Vite)
βββ server.js # SSR server bundleThe SSR output is only present when SSR is enabled.
π Running in Production β
The simplest deployment - just run the bundled server directly:
sh
node dist/front/api/server.jsFor more control, use the app factory at dist/*/api/app.js.
Koa - app.callback() is a Node.js (IncomingMessage, ServerResponse) handler. Deno and Bun support it via their node:http compat layer, not via their native serve APIs:
js
import { createServer } from "node:http";
import app from "./dist/front/api/app.js";
createServer(app.callback()).listen(3000);Hono - app.fetch is a Web Fetch API handler, so it plugs into each runtime's native server directly:
js
import { createServer } from "node:http";
import { getRequestListener } from "@hono/node-server";
import app from "./dist/front/api/app.js";
createServer(getRequestListener(app.fetch)).listen(3000);ts
import app from "./dist/front/api/app.js";
Deno.serve({ port: 3000 }, app.fetch);ts
import app from "./dist/front/api/app.js";
Bun.serve({ port: 3000, fetch: app.fetch });