Adapters

Neutron uses an Adapter system to build your application for different deployment targets. By changing a few lines of configuration, you can switch from a Node.js server to a Cloudflare Worker or a Docker container.

How Adapters Work

When you run neutron-ts build, the framework compiles your code. The final step is the "Adapt" phase, where the chosen adapter takes that compiled code and wraps it in the necessary entry points and configuration for your specific host.

Selecting an Adapter

Adapters ship bundled inside @neutron-build/core — there's no separate package to install. Select one at build time with the CLI's --preset flag:

npx @neutron-build/cli build --preset vercel

Available Presets

  • --preset docker: long-running Node server (produces dist/server.mjs + Dockerfile).
  • --preset cloudflare: Cloudflare Workers / Pages.
  • --preset vercel: Vercel Serverless / Edge Functions.
  • --preset static: pure static-site output (SSG).