[]previous and next page

bun

The Bun adapter: writes server.mjs, which serves the server bundle and the client folder with Bun.serve.

The Bun adapter: writes server.mjs, which serves the server bundle and the client folder with Bun.serve. Run it with bun <outDir>/server.mjs. It reads PORT (default 3000) and HOST (default 0.0.0.0).

Import#

ts
import { bun } from "@shadow-js/dusk/bun";

Signature#

ts
function bun(options: BunAdapterOptions = {}): Adapter

Parameters#

Name Description
options See BunAdapterOptions.

Returns#

The adapter for dusk({ adapter }).

Throws#

  • TypeError for an invalid outDir.

Examples#

ts
// vite.config.ts
import { dusk } from "@shadow-js/dusk/vite";
import { bun } from "@shadow-js/dusk/bun";
export default { plugins: [dusk({ adapter: bun() })] };