Runtimes
srvkit is built on srvx, which provides a universal serve() abstraction over the Web API Request/Response interface. Your server handler works across runtimes without changes — srvkit adapts the module resolution and build output to match each target.
The runtime option sets the bundler's resolve conditions to match the target environment, ensuring the correct conditional exports from your dependencies are used. For the workerd runtime, the bundler target is also set to webworker instead of node.
Setting the runtime
Use the runtime option in your plugin configuration:
The default runtime is "node".
Supported runtimes
node
The default. Produces output meant to run with Node.js.
The build resolves Node.js builtins and keeps them external. When using bundle: "standalone", only Node.js builtins remain as external imports.
deno
Produce output for the Deno runtime. Module resolution conditions are set for Deno compatibility.
bun
Produce output for the Bun runtime. Module resolution conditions are set for Bun compatibility.
workerd
Produce output for Cloudflare Workers. Use with build.target: "handler" to generate a handler that the Workers runtime can invoke directly.
The output exports a default fetch handler compatible with the Cloudflare Workers export default convention.