Each source folder builds independently.
sh
pnpm build # all source folders
pnpm build front # specific folderBuild 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 });